Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace docopt with clap #197

Merged
merged 1 commit into from
Feb 2, 2016
Merged

replace docopt with clap #197

merged 1 commit into from
Feb 2, 2016

Conversation

bookshelfdave
Copy link
Contributor

  • repo has been replaced with depot where it's visible to a user
  • Command structs can be obtained via FromStr
  • This has been replaced with a simple match on subcommand that returns a Handler fn pointer. This allows for the removal of repetitive code shared between every command.
  • default cli values are explicitly stored as constants (DEFAULT_GOSSIP_LISTEN etc)
  • The monster clap setup function chain is too long for rustfmt. It's been manually formatted and is now ignored by rustfmt.

Note: explicit casting to Handler is required *:

...
"config" => Some(configure as Handler)
...

@chef-delivery
Copy link
Contributor

This PR has passed 'Verify' and is ready for review and approval!
Use: '@delivery approve' when code review is complete.

let mut config = Config::new();
let command = try!(Command::from_str(subcommand));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE

@adamhjk
Copy link
Contributor

adamhjk commented Feb 2, 2016

gif-keyboard-7466506087067359546

@adamhjk
Copy link
Contributor

adamhjk commented Feb 2, 2016

@delivery approve

chef-delivery added a commit that referenced this pull request Feb 2, 2016
Merged change 3a040301-80ca-47f5-aed2-c083e261e4ad

From review branch dp_clap into master

Signed-off-by: adam <[email protected]>
@chef-delivery chef-delivery merged commit e0a4482 into master Feb 2, 2016
@chef-delivery chef-delivery deleted the dp_clap branch February 2, 2016 21:33
@chef-delivery
Copy link
Contributor

Change: 3a040301-80ca-47f5-aed2-c083e261e4ad approved by: @adamhjk

@chef-delivery
Copy link
Contributor

This PR has passed 'Acceptance' and is ready to be delivered!
Use: '@delivery deliver' when validated in acceptance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants