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

Usage string should display brackets for optional parameters #21

Closed
rojepp opened this issue Oct 8, 2014 · 6 comments
Closed

Usage string should display brackets for optional parameters #21

rojepp opened this issue Oct 8, 2014 · 6 comments

Comments

@rojepp
Copy link

rojepp commented Oct 8, 2014

It is customary to display optional parameters with brackets:

        --input <string>: The input file to read
        --sqlconnection <string> <string>: The sql server and database.
        [--sqlcredentials <string> <string>]: User and password for the database.
If not given, Windows authentication is assumed.
        --help [-h|/h|/help|/?]: display this list of options.
@eiriktsarpalis
Copy link
Member

In my use cases most of the arguments are optional, so not too sure about this. Perhaps the converse would be required, denoting that arguments are mandatory?

@rojepp
Copy link
Author

rojepp commented Oct 8, 2014

Using brackets for optional params is pretty standard. I'd rather you didn't come up with a standard for the reverse. ;)

@eiriktsarpalis
Copy link
Member

I would expect that bracket notation is usually kept for the first line of the usage string. Have you tried this?

parseResults.Usage(message = "Usage: cmd -foo [-bar]")

@rojepp
Copy link
Author

rojepp commented Oct 8, 2014

Good point! Maybe there should be an option to generate the usage string
automatically?

On Wed, Oct 8, 2014 at 5:38 PM, Eirik Tsarpalis notifications@github.com
wrote:

I would expect that bracket notation is usually kept for the first line of
the usage string. Have you tried this?

parseResults.Usage(message = "Usage: cmd -foo [-bar]")


Reply to this email directly or view it on GitHub
#21 (comment)
.

@eiriktsarpalis
Copy link
Member

Yeah, that sounds like a good idea.

On Wed, Oct 8, 2014 at 10:38 PM, Robert Jeppesen notifications@github.com
wrote:

Good point! Maybe there should be an option to generate the usage string
automatically?

On Wed, Oct 8, 2014 at 5:38 PM, Eirik Tsarpalis notifications@github.com

wrote:

I would expect that bracket notation is usually kept for the first line
of
the usage string. Have you tried this?

parseResults.Usage(message = "Usage: cmd -foo [-bar]")


Reply to this email directly or view it on GitHub
<
https://github.com/nessos/UnionArgParser/issues/21#issuecomment-58377752>
.


Reply to this email directly or view it on GitHub
#21 (comment)
.

@eiriktsarpalis
Copy link
Member

Should I assume that the issue was resolved by PR #25?

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

No branches or pull requests

2 participants