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

Prefix and postfix text in command usage string #3

Closed
veeg opened this issue May 10, 2016 · 4 comments
Closed

Prefix and postfix text in command usage string #3

veeg opened this issue May 10, 2016 · 4 comments

Comments

@veeg
Copy link

veeg commented May 10, 2016

Enable the ability to add additional text before and after usage text.
Currently, my master argument parser looks like this.

 prog {OPTIONS} [COMMAND]

I would like it to look like this

 prog {OPTIONS} [COMMAND] [<args>]

even tho the [<args>] bit is not backed up by any args from the master parser.

When the command parser gets a --help, i want the usage text to say

prog COMMAND {OPTIONS} [X] [Y] ......

This requires the disabling of the auto-appended argv[0] argument, and replace it with a string of my choice.

@Taywee
Copy link
Owner

Taywee commented May 10, 2016

argv[0] isn't actually automatically appended if you set Prog on the ArgumentParser manually, so the prefix is unnecessary, as you can set it there. I will look at adding this postfix text as an option, though.

@Taywee
Copy link
Owner

Taywee commented May 10, 2016

This is completed on tag 3.0.4

@veeg
Copy link
Author

veeg commented May 10, 2016

Ahh, lovely.

For reference, the 'prefix' can be added like this:

    parser.Prog("prefix string")

I may have failed to read the documentation thoroughly enough, but that is a a key point to bring up
in some overall documentation, just not API documentation.

@Taywee
Copy link
Owner

Taywee commented May 10, 2016

That's true. Being a header library that I've thrown together for my own use, it's easy for me to overlook something that somebody else might not see; it is also very young still.

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

No branches or pull requests

2 participants