4 ms·
Wait what? It would never occur to me to try to use a question mark as a command option at all. That's what "--help" is for. I'm actually surprised any program
by Hizonner 3y ago
Wait what? It would never occur to me to try to use a question mark as a command option at all. That's what "--help" is for. I'm actually surprised any program at all recognizes either form of the question mark.
... but don't get me started on people who think it's ok to use a single hyphen to start a multicharacter option, or don't let you put multiple single character options after the single hyphen...
- nneonneo 3y agoWindows uses /? as the standard help flag, so maybe there are tools that are ported from that convention? -h/--help are all I ever see in macOS CLI tools, in any case.
- JohnFen 3y agoI believe /? started well before Windows, with DOS. IIRC, it was used because -? was common with Unix and CP/M (and DOS is basically half Unix and half CP/M) -- but Microsoft made the decision to have '/' be the switch character rather than '-'. So, /? was inherited from what came before, just slightly modified.
- JohnFen 3y ago> It would never occur to me to try to use a question mark as a command option at all. That's what "--help" is for. -? has been a common switch for decades. I've been implementing it (along with the synonyms -h, --help, etc.) in all of my programs since about the '90s.
- bvisness 3y agoAnything a user tries to do to ask for help is correct behavior that you need to support. It is a crime to tell the user “you asked for help incorrectly”. I suggest supporting at least all of the following: -h, -help, --help, -?, /h, /?, help, <no flag> (if possible). Other flags don’t have to follow these rules, but I think help can be an exception. And maybe you should print the help any time the user enters a bad command.
- Hizonner 3y agoJust to be clear, I'm not saying programs shouldn't provide help in response to "`-?`". It sounds like a good idea to me, because that would be an obvious guess for what a user would mean by putting a question mark there. And, as you say, some help is a good response to any unrecognized option. I'm just saying that I hadn't realized programs did that. And I've been around a long, long time. I guess I'm just blind.
- HKH2 3y ago> ... but don't get me started on people who think it's ok to use a single hyphen to start a multicharacter option There are quite a few older programs that do that, including ImageMagick and FFmpeg.
- Hizonner 3y agoI'm pretty sure slavery was also going on when those programs started doing that. Doing it now is kind of different...