-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Value terminator is not included anywhere in help message #4812
Comments
I think your idea for having it in the argument list and in the usage like that works. My only concern is how much this increases the binary size as this is a less commonly used feature and users can provide custom usages. I'm open to at least an experimental implementation being made for us to evaluate. |
My main concern is that, if this is on one or multiple options instead of positional arguments, then trying to do it with a custom usage won't work quite so well. We can't currently overwrite the usage that is displayed in the Argument/Options list. |
I like this proposal, @epbuennig; I've used the underlying feature of Clap before, and it would definitely be nice if the help generator would show you the stop delimiter without the developer having to write a custom usage message. I'm generally for anything that quickly improves documentation quality and usability, and this feels like an easy win. I'm busy tonight, but I have some dedicated time tomorrow to work on this. I'll see what it does to binary size (seems like it should be a small positive delta?), and then we can see if your team likes it, @epage. |
Okay, my PR is in. Ended up thrashing against the CI for a bit, so sorry if that generated any annoying transient noise. Looks like CI is happy now, and all tests (including the 3 that I added to test this small feature) are passing. I only checked the binary delta on my M2, and it was negligible. I've used Clap for years, and this was a fun way to give something (admittedly small) back on a quiet evening. Thanks for the great tool! |
Closes clap-rs#5392 and clap-rs#4812, related to clap-rs#1052
Closes clap-rs#5392 and clap-rs#4812, related to clap-rs#1052
Closes clap-rs#5392 and clap-rs#4812, related to clap-rs#1052
Closes clap-rs#5392 and clap-rs#4812, related to clap-rs#1052
I'm keen on working on that, what's the desired solution in the end? |
Please complete the following tasks
Clap Version
v4.2.0
Describe your use case
The following rust program:
currently produces this output:
For a user, it is not clear that the options before
last
must be delimited with:
so the last argument is not assumed to be part ofmultiple_options
.Ideally, it should be included in both the usage itself and the Argument list in some way, mentioning it in the help message for each argument which may use this style would become tedious.
Describe the solution you'd like
I would expect the program to output something similar to this:
without any additional changes by default.
Alternatives, if applicable
An alternative to this is specifying the usage directly, but this falls flat as soon as
a
is turned into an option, as it's representation in the option list cannot be changed.It could also be explained in the help message of the argument itself, but I feel like the automatically generated usage strings should include this.
Additional Context
The following program already produces includes the
--
token for arguments specified asrequired(false)
andlast(true)
(although only in the usage), which is why I believe my feature request falls inline with the current design philosophy of clap.The text was updated successfully, but these errors were encountered: