-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Display titles of option groups in swift build --help
#6203
base: main
Are you sure you want to change the base?
Conversation
Recent versions of ArgumentParser support visual grouping of options specified with `@OptionGroup` property wrapper when `title` argument is provided. Let's do it for `swift build` to make its `--help` output cleaner.
@swift-ci smoke test |
Hm, not sure this adds a ton of value? The grouping into "global" and "build" options is fairly arbitrary and based on SwiftPM command structure and not on any real logical reasoning. I think what could be nice is breaking up those groups into actual logical units and titling those. Thanks for mentioning the feature, though! |
I've tried breaking up |
cc @bitjammer for input on desired UX |
Some specific comments on what I can see based on the description:
Personally, I'd like to sit down and make more fundamental changes to the usage of the swiftpm tools. That includes cleaning up how these "global" options cascade down to other commands, or what is or isn't a subcommand, such as One thought here from my work on the command line interfaces so far is that some options are much more common than others. Consider sorting options by their apparent frequency within groups as possible. Another thought: if we really must draw boxes around options, they should be task-oriented as much as possible. If there is only one task achievable by the tool, the groupings become somewhat arbitrary as Boris said. I don't have a better answer for this at this time as I haven't had the time to review all of the options again in detail. I hope that helps! |
Recent versions of ArgumentParser support visual grouping of options specified with
@OptionGroup
property wrapper whentitle
argument is provided. Let's do it forswift build
to make its--help
output cleaner.Help output before:
Help output after: