Skip to content

Commit

Permalink
Don't use clap's default_value for args that take values.
Browse files Browse the repository at this point in the history
Workaround for clap bug: clap-rs/clap#1140
where the arg will always be displayed in the usage string.
  • Loading branch information
arusahni committed Dec 28, 2019
1 parent 366d703 commit 59e6b52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion cli-flags.yml
Expand Up @@ -36,7 +36,6 @@ args:
help: Specify the remote to be used
takes_value: true
required: false
default_value: origin
- REQUEST_ID:
conflicts_with:
- NEW_PROJECT_ID
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Expand Up @@ -166,7 +166,8 @@ fn main() {
.author(crate_authors!("\n"))
.get_matches();

let remote_name = matches.value_of("REMOTE_NAME").unwrap();
// Not using Clap's default_value because of https://github.com/clap-rs/clap/issues/1140
let remote_name = matches.value_of("REMOTE_NAME").unwrap_or("origin");

if let Some(project_id) = matches.value_of("NEW_PROJECT_ID") {
set_project_id(remote_name, project_id);
Expand Down

0 comments on commit 59e6b52

Please sign in to comment.