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 argument ranges and defaults to command line help text. #74

Merged
merged 2 commits into from
Mar 29, 2024

Conversation

StaticPH
Copy link
Contributor

@StaticPH StaticPH commented Jan 6, 2024

In the absence of a manpage, it helps to include acceptable value ranges, and maybe even defaults, in the help output of a command. Granted, manually trying outlandish arguments does produce error messages which indicate ranges where relevant, but I see no reason for these to be mutually exclusive.
The exact format in which to include this information in the help output can be discussed; this just seemed good enough to me.
Ideally, these would be included programmatically, rather than hardcoded into the argument description strings, but I'd prefer to leave that up to the developer(s).

cmdapp/src/main.rs Outdated Show resolved Hide resolved
Co-authored-by: Viktor Szakats <[email protected]>
@tyt2y3
Copy link
Member

tyt2y3 commented Mar 1, 2024

Thanks! If we used StructOpt this would be much easier.

@tyt2y3 tyt2y3 merged commit 11769b0 into visioncortex:master Mar 29, 2024
13 checks passed
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

Successfully merging this pull request may close these issues.

3 participants