clap/tests/derive/structopt.rs
2021-12-02 20:26:21 -06:00

24 lines
606 B
Rust

#![allow(deprecated)]
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"]);
}