k6
k6 copied to clipboard
Revisit `k6 version` command and related configuration
Feature Description
Currently version of k6 can be looked up only with k6 version while k6 -v switches on verbose logging. Many people are more used to --version and -v flags instead. OTOH, k6 version is very likely required for backwards compatibility.
Suggested Solution (optional)
Add support for --version flag.
Already existing or connected issues / PRs (optional)
Original source: discussion in https://github.com/grafana/k6/pull/2334#discussion_r789781094
Yeah, k6 version can't be removed at this point, but I don't see a problem with also having --version for users that are used to other tools. I think that convention is mostly adopted by CLI tools that don't have sub-commands, and k6 version feels more appropriate for us and should still be the default though.
I am mostly against adding more flags and depending on cobra functionality. Yes it's unlikely we will ever ditch cobra, and even if we do this likely will be the least of our problems. But also I don't remember anyone ever complaining about the lack of --version so :shrug:
k6 version feels more appropriate for us and should still be the default though.
Based on the quote, same for me, one more flag without a concrete end goal doesn't sound a good thing
I'm chiming in to say that this gets me every time:
$ k6 --version
ERRO[0000] unknown flag: --version
It's just so against my normal expectations. I would bet a significant amount of money that I'm not the only one who has seen this error many times.[^1] [^1]: That error message could be better, but that's maybe a different issue.
But also I don't remember anyone ever complaining about the lack of --version so shrug
I think the annoyance is minor enough that most people won't complain. A person would have to be really nitpicky to complain about it. Anyway, I just complained about it internally and was directed to this issue.
Based on the quote, same for me, one more flag without a concrete end goal doesn't sound a good thing
Generally I am for exposing only one interface to do one thing. But conventions are strong here, and this is about as simple as a command can be, so I don't expect multiple ways would cause much confusion here. There's already k6 help and k6 --help.
Looking for a good first issue to start contributing I've done this PR. Just my 2 cents.