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

Make version number optional and reflect in help #21

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@jen20
Contributor

jen20 commented Sep 10, 2015

This commit modifies the BasicHelpFunc to check whether Version is an empty string, and if it is omits it from the help generated by BasicHelpFunc. It also adds a test of this behaviour.

This is useful in situations where you are using nested CLIs to get aws-cli style user interfaces, and conseuqently only want Version as a top level switch - for example:

    aws ec2 --help

should not list --version as an option, but

    aws --help

should list --version as an option.

Make version number optional and reflect in help
This commit modifies the BasicHelpFunc to check whether Version is an
empty string, and if it is omits it from the help generated by
BasicHelpFunc. It also adds a test of this behaviour.

This is useful in situations where you are using nested CLIs to get
aws-cli style user interfaces, and conseuqently only want Version as a
top level switch - for example:

    aws ec2 --help

Should not list --version as an option, but

    aws --help

Should list --version as an option.
@mitchellh

This comment has been minimized.

Show comment
Hide comment
@mitchellh

mitchellh Oct 16, 2015

Owner

So unfortunately for BC reasons we can't change the signature of the BasicHelpFunc function. I'd recommend just writing your own help function in the higher level project. Sorry!

Owner

mitchellh commented Oct 16, 2015

So unfortunately for BC reasons we can't change the signature of the BasicHelpFunc function. I'd recommend just writing your own help function in the higher level project. Sorry!

@mitchellh mitchellh closed this Oct 16, 2015

@jen20

This comment has been minimized.

Show comment
Hide comment
@jen20

jen20 Oct 17, 2015

Contributor

Understandable, it was obviously going to break upstream users of CLI in retrospect.

I think there's an alternative way of achieving the same thing that doesn't break existing users, I'll play with that and come back on it.

Contributor

jen20 commented Oct 17, 2015

Understandable, it was obviously going to break upstream users of CLI in retrospect.

I think there's an alternative way of achieving the same thing that doesn't break existing users, I'll play with that and come back on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment