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
structFeatherFeed:ParsableCommand{staticvarconfiguration=CommandConfiguration(
abstract:"FeatherFeed backend application.",
subcommands:[Run.self],
defaultSubcommand:Run.self
)...}extensionFeatherFeed{structRun:ParsableCommand{staticvarconfiguration=CommandConfiguration(
abstract:"Runs the FeatherFeed application.",
helpNames:[.long,.customShort("?")])@Option(name:.shortAndLong, help:"The host the server will run on.")varhost:String="::1"@Option(name:.shortAndLong, help:"The port the server will run on.")varport:Int=8080...}}
Expected behavior
> swift run feather-feed run --help
OVERVIEW: Runs the FeatherFeed application.
USAGE: feather-feed run [--host <host>] [--port <port>]
OPTIONS:
-h, --host <host> The host the server will run on. (default: ::1)
-p, --port <port> The port the server will run on. (default: 8080)
-?, --help Show help information.
Actual behavior
> swift run feather-feed run --help
OVERVIEW: Runs the FeatherFeed application.
USAGE: feather-feed run [--host <host>] [--port <port>]
OPTIONS:
-h, --host <host> The host the server will run on. (default: ::1)
-p, --port <port> The port the server will run on. (default: 8080)
-h, --help Show help information.
Discussion
Apparently subcommands are inheriting the helpNames configuration from the parent command. If I change helpNames for the FeatherFeed command, the Run subcommand inherits the -? flag.
The text was updated successfully, but these errors were encountered:
@natecook1000 I have a question regarding this issue. Should Subcommands inherit helpNames from its parent if not modified? Or if not modified, helpNames for Subcommands would be -h, --help regardless how it is defined in the parent command?
I would think an inheritance model would make the most sense, and would be compatible with the current system. So subcommands get whatever their super-commands have specified, unless they specify their own. I think this means that we’d need to change the property to be optional and have it default to nil, however.
modifying-the-help-flag-names does not work for subcommands.
Possibly related to #36.
Checklist
master
branch of this packageSteps to Reproduce
Expected behavior
Actual behavior
Discussion
Apparently subcommands are inheriting the
helpNames
configuration from the parent command. If I changehelpNames
for theFeatherFeed
command, theRun
subcommand inherits the-?
flag.The text was updated successfully, but these errors were encountered: