From 129fd38e003d2ab23bad2ceb84f59bb74b4ae45b Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 18 May 2015 10:19:32 +0200 Subject: [PATCH] imp(CLI): disallow empty values explicitly [skip ci] --- etc/api/type-cli.yaml | 2 +- src/mako/cli/lib/argparse.mako | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/etc/api/type-cli.yaml b/etc/api/type-cli.yaml index 82f29a1772..a78262a082 100644 --- a/etc/api/type-cli.yaml +++ b/etc/api/type-cli.yaml @@ -30,4 +30,4 @@ cargo: - yup-hyper-mock = "*" - serde = ">= 0.3.0" - serde_macros = "*" - - clap = "*" + - clap = ">= 0.9.1" diff --git a/src/mako/cli/lib/argparse.mako b/src/mako/cli/lib/argparse.mako index 2c2ae7cfcb..d4f7afc356 100644 --- a/src/mako/cli/lib/argparse.mako +++ b/src/mako/cli/lib/argparse.mako @@ -272,7 +272,8 @@ for &(main_command_name, ref about, ref subcommands) in arg_data.iter() { (_ , &Some(f)) => f, _ => unreachable!(), }; - let mut arg = Arg::with_name(arg_name_str); + let mut arg = Arg::with_name(arg_name_str) + .empty_values(false); if let &Some(short_flag) = flag { arg = arg.short(short_flag); }