From 88ea432b9259877b9608379fc143aa3e7621640a Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 26 Nov 2021 15:59:13 +1100 Subject: [PATCH] Remove version & author from each subcommand Currently every individual subcommand of youki has clap attributes giving the youki version and authors. That seems a bit redundant, since this information is also on the top level Opts structure. Having the tags on each does have an effect though: it means that, e.g. "youki create --help" will give the version and author, as well as plain "youki --help". Likewise "youki create --version" will give a result as well as "youki --version". Including this is of limited value, though, since it can be easily obtained from the top level command. It also provides a barrier to splitting out the frontend argument parsing from the rest of youki, so remove it. Signed-off-by: David Gibson --- crates/youki/src/main.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/crates/youki/src/main.rs b/crates/youki/src/main.rs index 2782ef68..c47a289f 100644 --- a/crates/youki/src/main.rs +++ b/crates/youki/src/main.rs @@ -48,35 +48,22 @@ struct Opts { // Also for a short information, check [runc commandline documentation](https://github.com/opencontainers/runc/blob/master/man/runc.8.md) #[derive(Parser, Debug)] enum SubCommand { - #[clap(version = crate_version!(), author = "youki team")] Create(liboci_cli::Create), - #[clap(version = crate_version!(), author = "youki team")] Start(liboci_cli::Start), - #[clap(version = crate_version!(), author = "youki team")] State(liboci_cli::State), - #[clap(version = crate_version!(), author = "youki team")] Kill(liboci_cli::Kill), - #[clap(version = crate_version!(), author = "youki team")] Delete(liboci_cli::Delete), - #[clap(version = crate_version!(), author = "youki team")] Events(liboci_cli::Events), - #[clap(version = crate_version!(), author = "youki team")] Exec(liboci_cli::Exec), - #[clap(version = crate_version!(), author = "youki team")] List(liboci_cli::List), - #[clap(version = crate_version!(), author = "youki team")] Pause(liboci_cli::Pause), - #[clap(version = crate_version!(), author = "youki team", setting=clap::AppSettings::AllowLeadingHyphen)] + #[clap(setting=clap::AppSettings::AllowLeadingHyphen)] Ps(liboci_cli::Ps), - #[clap(version = crate_version!(), author = "youki team")] Resume(liboci_cli::Resume), - #[clap(version = crate_version!(), author = "youki team")] Run(liboci_cli::Run), - #[clap(version = crate_version!(), author = "youki team")] Spec(liboci_cli::Spec), - #[clap(version = crate_version!(), author = "youki team")] Info(info::Info), }