-
What I am trying to achieve is a CLI that parses the following:
#[derive(Clap, Debug)]
#[clap(author, version)]
pub struct App {
#[clap(short = "e", long)]
pub edit: bool,
#[clap(index(2), last(true), required_if("edit", "true"))]
pub template: Option<String>,
#[clap(global(true), index(1), name = "REPO", parse(from_os_str), default_value = ".")]
pub repo_path: PathBuf,
#[clap(subcommand)]
pub sub_command: Option<Command>,
}
#[derive(Clap, Debug)]
pub enum Command {
Init,
} If I run |
Beta Was this translation helpful? Give feedback.
Answered by
mainrs
Jul 21, 2020
Replies: 1 comment
-
I "solved" it be redesigning my CLI. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mainrs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I "solved" it be redesigning my CLI.