Kuadrant / kuadrantctl

Kuadrant configuration command line utility
Apache License 2.0
6 stars 13 forks source link

Format of version command #90

Closed pehala closed 3 months ago

pehala commented 3 months ago

Currently the format looks like this: {"level":"info","ts":"2024-06-24T08:58:28+02:00","msg":"kuadrantctl version: v0.2.3"} While the format does convey the actual version, it has a few small issues: 1) For some reason we have request date and log level as well even though they are not that relevant 2) It is outputted in stderr instead of stdout 3) The actual result is under msg key and in string format

ehearneRedHat commented 3 months ago

Hi @pehala ,

I can see the first two can be resolved quite easily, but I am unsure how to resolve the third.

My proposed solution would be to add another field simply called version . So, once it is stdout, and no timestamp/log level, the output could look like

{"version": "v0.2.3", "msg": "kuadrantctl version: v0.2.3"}

Of course, we could just remove msg and use version instead, but I am thinking of the usecase of programatically parsing the version, and maybe we want to let the user know that it is kuadrantctl that they are getting the version from?

Let me know your thoughts. :)

pehala commented 3 months ago

I think t

My proposed solution would be to add another field simply called version . So, once it is stdout, and no timestamp/log level, the output could look like

{"version": "v0.2.3", "msg": "kuadrantctl version: v0.2.3"}

I like that solution a lot! Covers all usecases nicely :)

ehearneRedHat commented 3 months ago

@pehala Awesome, I'll get on it. :)

ehearneRedHat commented 3 months ago

Closing as version command on main meets most of the specified requirements.

$ ./bin/kuadrantctl version
kuadrantctl v0.2.4-dev (64f6301)
ehearneRedHat commented 3 months ago

We have decided not to go forward with the third proposal for now.