You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Option groups are currently just splatted into the rest of the declared arguments for a command. This is sometimes fine, but often it would be nice if option groups were separated and labeled, which would (a) help readability in complex commands and (b) help users understand which options carry over across multiple subcommands.
For example, for declarations like this:
structOptions:ParsableArguments{@Flag(help:"Display extra information while processing.")varverbose= false
@Option(help:"The number of extra lines to show.")varextraLines=0}structExample:ParsableCommand{@OptionGroup(title:"Shared Options")vargroup:Options@Flag(help:"Parse as a binary file.")varparseAsBinary= false
@Argument(help:"The input file.")varinputFile:String?}
The help screen could look something like:
% example --help
USAGE: example [--verbose] [--extra-lines <extra-lines>] [--parse-as-binary] <input-file>
ARGUMENTS:
<input-file> The input file.
OPTIONS:
--parse-as-binary Parse as a binary file.
SHARED OPTIONS:
--verbose Display extra information while processing.
--extra-lines <extra-lines>
The number of extra lines to show. (default: 0)
-h, --help Show help information.
The text was updated successfully, but these errors were encountered:
Option groups are currently just splatted into the rest of the declared arguments for a command. This is sometimes fine, but often it would be nice if option groups were separated and labeled, which would (a) help readability in complex commands and (b) help users understand which options carry over across multiple subcommands.
For example, for declarations like this:
The help screen could look something like:
The text was updated successfully, but these errors were encountered: