Commandant icon indicating copy to clipboard operation
Commandant copied to clipboard

Detect --help, and run help

Open aaroncrespo opened this issue 7 years ago • 2 comments

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

aaroncrespo avatar Mar 31 '17 17:03 aaroncrespo

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: [])
+  }  

aaroncrespo avatar Mar 31 '17 17:03 aaroncrespo

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).

NachoSoto avatar Mar 31 '17 18:03 NachoSoto