Hacker News new | ask | show | jobs
by runeks 959 days ago
> The world would have been a much better place if CLIs themselves defined strict interfaces using standard data structures.

Well it's not too late just yet.

How about if all CLI exes had an option, say --dump-cli-options, that wrote out a spec of the supported commands/flags/options?

Something like e.g. Python's argparse should be able to effortlessly spit out this info (and the same for other similar argument parsing libraries).

2 comments

And we would also need an options that does CLI argument parsing only, and either returns an error related to parsing one or more options or "ok".

This could be used to do "form validation" of CLI args as they're typed in the shell.

Lots do it's called help. But then they would all have to use the same spec, which we know would never happen.