Hacker News new | ask | show | jobs
by judofyr 674 days ago
I too wish that command-line arguments were standardized, but alas, we were given `char *argv[]` and I've finally accepted (yes, I'm looking at you Go) that the only way is to read the documentation and type the command exactly as described, with dashes and equals intact :(
1 comments

If you think about it, a CLI argument parser takes in a sequence of tokens and transforms the information into some kind of internal repsentation, which is then later interpreted. Just like what a compiler/interpreter does, except now the input is already tokenized. So there does not seem to be a practical way to "standardize" this interface any more than you can standardize a compiler for all languages.

It's kinda whacky to think about that every sufficiently complicated CLI app out there implements its own ad-hoc, informally-specified, bug-ridden, slow implementation of half of common lisp _just_ to prepare running the actual program payload...