Commandant
Commandant copied to clipboard
Detect --help, and run help
Unrecognized command: '--help'. See carthage help.
is not as helpful as it could be when parsing commands
if the argument that failed to parse contains help
but was not exactly "executable help" the error should be printed and executable help
should be run.
Maybe even -h
Im not sure the feasibility but
- fputs("Unrecognized command: '\(verb)'. See `\(executableName) help`.\n", stderr)
+ fputs("Unrecognized command: '\(verb)'. See `\(executableName) help`.\n", stderr)
+ if NSRegularExpression(pattern: "-h|help|--help", options: []).numberOfMatches(verb) > 0 {
+ _ = run(command: "help", arguments: [])
+ }
Same for carthage {command} --help
as an equivalent to carthage help command
. I think this will help a lot of people (including me, who always forgets this syntax).