Skip to content

Conversation

@myarmolinsky
Copy link
Contributor

@myarmolinsky myarmolinsky commented Aug 27, 2025

Makes the help command args() function distinguish optional arguments

@mdonnalley
Copy link
Contributor

@myarmolinsky Thanks for taking the take to submit a PR.

Per the spec, both upper case and angle brackets are valid ways of specifying required arguments:

https://docopt.readthedocs.io/en/0.4.0/#usage-pattern-format

<arguments>, ARGUMENTS. Arguments are specified as either upper-case words, e.g. my_program.py CONTENT-PATH or words surrounded by angular brackets: my_program.py .

Because of that I'm not inclined to accept the PR unless there's strong community support for it. However, I would accept a PR that adds an configuration option to enable angle brackets - if that's something you're interested in doing.

@myarmolinsky
Copy link
Contributor Author

myarmolinsky commented Oct 14, 2025

Understood @mdonnalley , thank you for the information and for evaluating this PR. We will consider PRing the configuration option. In the meantime, would you consider the second commit (without the <> part)? The help command does not currently distinguish optional from required if I am not mistaken, so it would still be beneficial in my opinion

@mdonnalley
Copy link
Contributor

@myarmolinsky Thanks for point that out - I missed that in the PR description.

Yeah, I'm happy to merge that change

@myarmolinsky myarmolinsky force-pushed the help-required-indicator branch from cf3cfa5 to 2c2f63a Compare October 15, 2025 11:35
@myarmolinsky myarmolinsky changed the title fix: improve clarity of required arguments shown in help command fix: indicate whether an argument is optional in the help command Oct 15, 2025
@myarmolinsky
Copy link
Contributor Author

Thanks @mdonnalley , I have dropped the first commit and updated the second to only apply [], not <>

@mdonnalley mdonnalley changed the base branch from main to mdonnalley/1453 October 15, 2025 14:57
@mdonnalley
Copy link
Contributor

@myarmolinsky Thanks! I'm going to merge this into a separate feature branch so that all the integration tests can run. Once those pass, I'll merge to main

@mdonnalley mdonnalley merged commit 6f5aa00 into oclif:mdonnalley/1453 Oct 15, 2025
1 check passed
mdonnalley added a commit that referenced this pull request Oct 15, 2025
) (#1482)

* fix: indicate whether an argument is optional in the help command (#1453)

* test: update help unit tests

---------

Co-authored-by: Matthew Yarmolinsky <yarmolinskymatthew@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants