k6 icon indicating copy to clipboard operation
k6 copied to clipboard

Revisit `k6 version` command and related configuration

Open yorugac opened this issue 3 years ago • 4 comments

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

yorugac avatar Jan 25 '22 13:01 yorugac

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.

na-- avatar Jan 25 '22 14:01 na--

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:

mstoykov avatar Jan 25 '22 14:01 mstoykov

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

codebien avatar Jan 25 '22 14:01 codebien

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.

MattDodsonEnglish avatar Sep 16 '22 19:09 MattDodsonEnglish

Looking for a good first issue to start contributing I've done this PR. Just my 2 cents.

ffapitalle avatar Nov 06 '23 20:11 ffapitalle