Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

don't print help after successful command #33

Merged
merged 2 commits into from
May 6, 2014
Merged

don't print help after successful command #33

merged 2 commits into from
May 6, 2014

Conversation

mcquin
Copy link
Contributor

@mcquin mcquin commented Apr 30, 2014

(chef-dk, stop being so helpful.)

sometimes help was printing after commands like chef gem which chef \cc @opscode/client-eng

handle_options
elsif have_command?(subcommand_name)
subcommand = instantiate_subcommand(subcommand_name)
exit_code = subcommand.run_with_default_options(subcommand_params)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think other commands might be doing hacky stuff to remove the subcommand name from the argv array. This is much better, but we need to check each command to fix them for this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Odd, I see now this is the same logic as before, but, for example, the verify command does this: https://github.com/opscode/chef-dk/blob/master/lib/chef-dk/command/verify.rb#L105 We should investigate that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dan, it doesn't look like that unshift does anything (well, it prepends nothing to the array). The verify command doesn't get verify as a parameter, none of the subcommands get passed their name (https://github.com/opscode/chef-dk/blob/help-command/lib/chef-dk/cli.rb#L56).

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, derp. We should remove that, then. Good catch.

@sersut
Copy link

sersut commented May 6, 2014

👍

mcquin added a commit that referenced this pull request May 6, 2014
don't print help after successful command
@mcquin mcquin merged commit be60c70 into master May 6, 2014
@sethvargo sethvargo deleted the help-command branch May 7, 2014 14:26
@chef-boneyard chef-boneyard locked and limited conversation to collaborators Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants