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

Add support for argument definition #29

Closed
tchap opened this issue Aug 13, 2013 · 10 comments
Closed

Add support for argument definition #29

tchap opened this issue Aug 13, 2013 · 10 comments
Labels
kind/feature describes a code enhancement / feature request

Comments

@tchap
Copy link

tchap commented Aug 13, 2013

The help template contains just [arguments...], but it would be very useful if it was possible to define those arguments (optional arguments including) and see them in help, i.e. to se ARG1 ARG2 [ARG2] in the usage if ARG2 is optional instead of just [arguments...].

@codegangsta
Copy link
Contributor

This is an interesting idea, I would have to give some thought on how I might want this to work

@codegangsta
Copy link
Contributor

I'm thinking something simple like:
App.ArgsHelp & Command.ArgsHelp

Will provide the functionality we would want. The default will be "[arguments...]" but can be overridden easily.

codegangsta added a commit that referenced this issue Oct 24, 2013
@codegangsta
Copy link
Contributor

I added a commit to this but not quite sure how I feel about it. I'm going to tag this to add later as it is not a deal breaker (the template can easily be tweaked)

@shepmaster
Copy link

Can I customize [arguments ...] for a single command? It looks like the template is shared for all commands. As an example, I have these two commands with differing arguments:

cmd add name value
cmd rm name

I'm not sure how I could currently describe the two different sets of arguments.

@gravis
Copy link
Member

gravis commented Jun 16, 2014

This feature would be very helpful!

@matope
Copy link

matope commented Aug 15, 2014

👍 It would be really nice to have argument difinitions!

@AudriusButkevicius
Copy link
Contributor

My pull request has some support of that, not sure if its enough though :)

@matope
Copy link

matope commented Aug 16, 2014

@AudriusButkevicius I've seen your PR. That looks very good.
It would be perfect for me if the arguments are printed in a help message.

@AudriusButkevicius
Copy link
Contributor

Feel free to fork it.
Since I have help disabled for all of my commands, and all of my commands have subcommands, there is no way to list the arguments sensibly there.

@jszwedko
Copy link
Contributor

Rolling this into #140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature describes a code enhancement / feature request
Projects
None yet
Development

No branches or pull requests

7 participants