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

Option to customize "<value>" in docopts help usage strings #1088

Closed
kemley76 opened this issue May 30, 2024 · 4 comments · Fixed by #1095
Closed

Option to customize "<value>" in docopts help usage strings #1088

kemley76 opened this issue May 30, 2024 · 4 comments · Fixed by #1095

Comments

@kemley76
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I am working on a CLI that currently has a lot of manually written usage strings (seen in help menus) for commands. I want to remove them to allow Oclif's docopts functionality to autogenerate them, but this would force the removal of helpful information only the manual formatting could contain.

Example:

USAGE
    $ mycli add -i <input-files>...

would be autogenerated as

USAGE
    $ mycli add -i <value>

This "<value>" seems to be a hardcoded value, even when changing the flag's helpValue property. It also does not include the ... to indicate multiple inputs are allowed. The docopts site uses these notations quite a bit it seems.

Describe the solution you'd like
I would like an optional flag property (separate from the current helpValue) that can control this value, which could default to '<value>'. It would be used in autogenerating the docopts for the usage strings in the help menus. Perhaps this sort of feature could be extended to positional arguments, but that is not really my main concern.

I'd appreciate any help or guidance you could provide on this issue.

@mdonnalley
Copy link
Contributor

I would like an optional flag property (separate from the current helpValue) that can control this value

@kemley76 what's the rationale behind having a separate property? I'd imagine most people who are setting helpValue would want to same to be used in the usage

@kemley76
Copy link
Contributor Author

kemley76 commented Jun 3, 2024

I guess there is no real reason to have it be a separate property. I figured that would allow for more flexibility, but I agree, I don't see a reason to have them different. For what I wanted to do with it, extending the current helpValue is all I would need.

@mdonnalley
Copy link
Contributor

Got it. We can always add a separate property later if people need it. Do you want to update your PR to use helpValue? If so, I'll review and test it out this week

@kemley76
Copy link
Contributor Author

kemley76 commented Jun 4, 2024

My PR is now updated.

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

Successfully merging a pull request may close this issue.

2 participants