From 89432cc64600ba0711e412c6cf6b1e06e2f11102 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sat, 2 May 2015 09:57:00 +0200 Subject: [PATCH] fix(CLI): gate usage of `upload_media_params` Previously the local stack variable would be used even though it wasn't initialized as there were no upload flags. Now this only happens if there are media params. [skip ci] --- src/mako/cli/lib/argparse.mako | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mako/cli/lib/argparse.mako b/src/mako/cli/lib/argparse.mako index 24d789ceb0d..75642be5d06 100644 --- a/src/mako/cli/lib/argparse.mako +++ b/src/mako/cli/lib/argparse.mako @@ -287,6 +287,7 @@ for &(main_command_name, ref about, ref subcommands) in arg_data.iter() { if let &Some(multi) = multi { arg = arg.multiple(multi); } + % if have_media_params: if arg_name_str == "${MODE_ARG}" { arg = arg.number_of_values(2); arg = arg.value_names(&upload_value_names); @@ -298,6 +299,7 @@ for &(main_command_name, ref about, ref subcommands) in arg_data.iter() { .help("The file's mime time, like 'application/octet-stream'") .takes_value(true)); } + % endif scmd = scmd.arg(arg); } mcmd = mcmd.subcommand(scmd);