4 ms·
In my experience at Google, only Go does flags like this. Everything else (python, java, c++, blaze) all use the same flag syntax, which is all via long args wi
by QuercusMax 6y ago
In my experience at Google, only Go does flags like this. Everything else (python, java, c++, blaze) all use the same flag syntax, which is all via long args with two dashes.
- ben0x539 6y agoThis seems pretty "standard": https://fuchsia.googlesource.com/fuchsia/+/master/docs/concepts/api/cli.md#command-line-arguments https://fuchsia.googlesource.com/fuchsia/+/master/docs/conce... Is it based on Google's internal preferences?
- QuercusMax 6y agoTBH I have no idea; I've heard of Fuchsia, but know nothing about it. It seems pretty far removed from the majority of work I've done in Google3 (the monorepo).
- tdeck 6y agoI have seen a mix. For example, many Android developer tools (not written in Go) use this single-dash style. I believe the standard libraries used for parsing in internal tools mostly support both syntaxes, although some docs do describe the old single-dash style by default.
- re 6y agoThe Java ecosystem has historically used single-dash options, both the SDK tooling (e.g. `java -jar`, `javac -classpath`) and classic common libraries like Jakarta Commons CLI. It has moved away from it more in recent years so now you get a mishmash of single and double dashes depending on how old the option is. In some cases you end up with stuff like `java -showversion` which prints the version to stderr but ` java --show-version` which prints to stdout.
- TeMPOraL 6y agoPowerShell picked up the single-dash flag syntax too.