6 ms·
Everything uses --version, except `java -version`. Except Java 17. Java 17 went to `java --version`. And `java -version` doesn’t work anymore (Yes I jumped fro
by laurent92 4y ago
Everything uses --version, except `java -version`.
Except Java 17. Java 17 went to `java --version`. And `java -version` doesn’t work anymore (Yes I jumped from Java 8 to 17, but most people did).
- dcminter 4y agoI think at one point the canonical approach may even have been: java -D-version
- Wevah 4y agoAnd (e.g.) OpenSSL IS `openssl version`, with no dashes at all.
- saghm 4y agoTo be fair, when deciding how to implement CLI options, it's probably advisable to run as far away as you can from drawing any sort of inspiration from openssl. Even git looks like a paragon of UX compared to the openssl CLI.
- account42 4y agoYou don't think that -text -noout is an intuitive way to output something as text?
- yakubin 4y agomawk is the worst, which, given the article's claim about POSIX, is ironic, because mawk is POSIX-compliant. $ mawk --version mawk: not an option: --version $ mawk --help mawk: not an option: --help $ mawk -W version mawk 1.3.4 20200120 Copyright 2008-2019,2020, Thomas E. Dickey Copyright 1991-1996,2014, Michael D. Brennan random-funcs: srandom/random regex-funcs: internal compiled limits: sprintf buffer 8192 maximum-integer 2147483647 And mawk is (was in 16.04 at least) the default version of awk on Ubuntu. How is the user supposed to know this magic incantation? ¯\_(ツ)_/¯
- mananaysiempre 4y agoTo be fair, I can see this coming out of a strict reading of POSIX: it doesn’t say a single word about GNU-style long options (though there is an implied hole where they can fit), but explicitly leaves -W with an argument as a place for implementation-defined crufties when passed to Awk (I haven’t the slightest idea why). (Honestly I’d rather not have the convention of programs themselves handling this at all and instead have this be `ident awk` or similar, but I understand this is not going to happen.)
- saghm 4y agoI can only imagine that the "w" stands for "what the hell do I need to pass this thing to get it to tell me something useful"
- layer8 4y agoWhen development on Java started in 1991, double-dash long options weren’t as prevalent as they are today.
- twic 4y ago-version still works: $ java -version openjdk version "18" 2022-03-22 OpenJDK Runtime Environment Temurin-18+36 (build 18+36) OpenJDK 64-Bit Server VM Temurin-18+36 (build 18+36, mixed mode, sharing)