Skip to content

Render mutually exclusive flags as alternation in help output - #984

Open
aniketatgithub wants to merge 1 commit into
apple:mainfrom
aniketatgithub:fix-831-help-exclusivity-831
Open

aniketatgithub wants to merge 1 commit into
apple:mainfrom
aniketatgithub:fix-831-help-exclusivity-831

Conversation

@aniketatgithub

Copy link
Copy Markdown

Fix how mutually exclusive flags render in help output.

EnumerableFlag groups were listed as independent flags in the usage synopsis ([--a] [--b] [--c]), which reads like any combination is allowed. The synopsis now renders one alternation per group ([--a | --b | --c]), matching how the parser actually treats them. The default marker on a flag row also read (default: --a), repeating the flag's own name; it now reads (default).

Fixes #831.

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

Usage synopsis now shows one alternation per EnumerableFlag group
([--a | --b | --c]) instead of independent flags, and the default
marker on a flag row reads (default) instead of (default: --a).

Fixes apple#831

Signed-off-by: Aniket <aniketkomailkro@gmail.com>
@aniketatgithub

Copy link
Copy Markdown
Author

Hi, gentle bump. This renders mutually exclusive flags as alternation in help output. Ready for review.

This branch has not been deployed

No deployments
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.

Mutually exclusive EnumerableFlag & RawRepresentable flags aren't documented as such in command help, possibly elsewhere

1 participant