Skip to content

Commit

Permalink
fix(CLI): gate usage of upload_media_params
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
Byron committed May 2, 2015
1 parent 75b80de commit 89432cc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mako/cli/lib/argparse.mako
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 89432cc

Please sign in to comment.