clap/tests/derive/structopt.rs

24 lines
528 B
Rust
Raw Normal View History

2021-12-03 02:20:50 +00:00
#![allow(deprecated)]
use clap::{AppSettings, StructOpt};
#[test]
fn compatible() {
#[derive(StructOpt)]
#[structopt(author, version, about)]
#[structopt(global_setting(AppSettings::PropagateVersion))]
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"]);
}