mirror of
https://github.com/clap-rs/clap
synced 2024-12-15 07:12:32 +00:00
23 lines
583 B
Rust
23 lines
583 B
Rust
|
use clap::{AppSettings, StructOpt};
|
||
|
|
||
|
#[test]
|
||
|
fn compatible() {
|
||
|
#[derive(StructOpt)]
|
||
|
#[structopt(author, version, about)]
|
||
|
#[structopt(global_setting(AppSettings::PropagateVersion))]
|
||
|
#[structopt(global_setting(AppSettings::UseLongFormatForHelpSubcommand))]
|
||
|
struct Cli {
|
||
|
#[structopt(subcommand)]
|
||
|
command: Commands,
|
||
|
}
|
||
|
|
||
|
#[derive(StructOpt)]
|
||
|
#[structopt(setting(AppSettings::SubcommandRequiredElseHelp))]
|
||
|
enum Commands {
|
||
|
/// Adds files to myapp
|
||
|
Add { name: Option<String> },
|
||
|
}
|
||
|
|
||
|
Cli::from_iter(["test", "add"]);
|
||
|
}
|