-
Notifications
You must be signed in to change notification settings - Fork 353
Open
Description
The help text output by the default help subcommand doesn't seem proper to me:
- The
USAGEsection doesn't show-h,--help, or--versionif they are autogenerated - The
USAGEsection doesn't indicate that<subcommand>is optional, or that it can be followed by additional arguments - The
OPTIONSsection lists--versionbefore-h, --help, but I think they should be sorted alphabetically - The
SUBCOMMANDSsection doesn't showhelp … Show help information., which I think should be inserted alphabetically in the subcommand list
ArgumentParser version:
main
Swift version: Paste the output of swift --version here.
swift-driver version: 1.127.14.1 Apple Swift version 6.2.1 (swiftlang-6.2.1.4.8 clang-1700.4.4.1)
Target: arm64-apple-macosx26.0
Checklist
- If possible, I've reproduced the issue using the
mainbranch of this package - I've searched for existing GitHub issues
Steps to Reproduce
Run the help subcommand of a command that has both a default help subcommand and that has CommandConfiguration.version set. They needn't exist together, but doing this shows both problems at once.
Expected behavior
Top-level help output:
OVERVIEW: Command
USAGE: cmd [(-h | --help) [<subcommand>] | --version | <subcommand> *…]
OPTIONS:
-h, --help Show help information.
--version Show the version.
SUBCOMMANDS:
a A
b B
c C
help Show help information.
Actual behavior
Top-level help output:
OVERVIEW: Command
USAGE: cmd <subcommand>
OPTIONS:
--version Show the version.
-h, --help Show help information.
SUBCOMMANDS:
a A
b B
c C
Metadata
Metadata
Assignees
Labels
No labels