From e8ed1b08af2d729cfe68265c625dae8fb5dfa8a8 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott <ian@iandouglasscott.com> Date: Fri, 23 Jun 2017 16:01:14 -0700 Subject: [PATCH] Mark arguments as required --- src/bin/pkg.rs | 59 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/src/bin/pkg.rs b/src/bin/pkg.rs index f89897a..8b0c397 100644 --- a/src/bin/pkg.rs +++ b/src/bin/pkg.rs @@ -90,29 +90,42 @@ fn main() { let repo = Repo::new(env!("TARGET")); let matches = App::new("pkg") - .subcommand( - SubCommand::with_name("clean") - .arg(Arg::with_name("package").multiple(true)) - ).subcommand( - SubCommand::with_name("create") - .arg(Arg::with_name("package").multiple(true)) - ).subcommand( - SubCommand::with_name("extract") - .arg(Arg::with_name("package").multiple(true)) - ).subcommand( - SubCommand::with_name("fetch") - .arg(Arg::with_name("package").multiple(true)) - ).subcommand( - SubCommand::with_name("install") - .arg(Arg::with_name("package").multiple(true)) - ).subcommand( - SubCommand::with_name("list") - .arg(Arg::with_name("package").multiple(true)) - ).subcommand( - SubCommand::with_name("sign") - .arg(Arg::with_name("file").multiple(true)) - ).subcommand( - SubCommand::with_name("upgrade") + .subcommand(SubCommand::with_name("clean") + .arg(Arg::with_name("package") + .multiple(true) + .required(true) + ) + ).subcommand(SubCommand::with_name("create") + .arg(Arg::with_name("package") + .multiple(true) + .required(true) + ) + ).subcommand(SubCommand::with_name("extract") + .arg(Arg::with_name("package") + .multiple(true) + .required(true) + ) + ).subcommand(SubCommand::with_name("fetch") + .arg(Arg::with_name("package") + .multiple(true) + .required(true) + ) + ).subcommand(SubCommand::with_name("install") + .arg(Arg::with_name("package") + .multiple(true) + .required(true) + ) + ).subcommand(SubCommand::with_name("list") + .arg(Arg::with_name("package") + .multiple(true) + .required(true) + ) + ).subcommand(SubCommand::with_name("sign") + .arg(Arg::with_name("file") + .multiple(true) + .required(true) + ) + ).subcommand(SubCommand::with_name("upgrade") ).get_matches(); match matches.subcommand() { -- GitLab