3.0.1
$ singularity --version
3.0.1-71.g9b2e243
singularity --versionin singularity 2.* return:
$ singularity --version
2.5.2-dist
singularity --version in singularity 3.* return:
$ singularity --version
singularity version 3.0.1-71.g9b2e243
$ singularity --version
I would also suggest to remove "singularity version" and stick to returning just the version. By way of calling "singularity --version" the user already knows that he/she is going to produce a string that represents singularity version. With the added string, a program calling the action has extra to parse, potentially leading to more bugs. In that the original format worked well, I don't see rationale to change it. As it has done in the case of Singularity Python, it makes parsing the version string a little bit harder, and inconsistent behavior between versions 3 and up and 3 and below. Could the maintainers please share the benefits of doing this change? It could be that we are missing something important. Thank you!
@ArangoGutierrez
@al3x609 @vsoch
Hello! This change was done by a change in toolset, not anything we set out to do intentionally (it appears).
The cobra package we're using for building subcommands automatically adds the --version flag to the singularity command. The default format is what you're seeing.
We did create a specific command to output the version (singularity version) that does follow the version convention you all are expecting.
Just out of curiosity I've looked through a dozen or so common command-line tools and none of them just print the version and exit. They all have additional text (examples: perl, python, vim, git, bash, homebrew, vagrant, ack, go, etc).
The common choice seems to be '
Let's go ahead and lock down a consistent version string output and I will fix things up and add tests so it works as expected in the future.
This page has a few good examples of how to customize version:
https://sbstjn.com/create-golang-cli-application-with-cobra-and-goxc.html
They also have an example of how to add during build / compile, which may be good for Singularity! We used to base it on the github branch, and that was helpful to figure out "what version of master" (or similar) was installed from. Here is my old 2.6 version:
$ singularity --version
2.6.0-HEAD.579c415
And thank you @jscook2345 ! :)
on 3.0 we are moving to a UNIX standard
[eduardo@rhel7 singularity]$ git --version
git version 2.9.5
[eduardo@rhel7 singularity]$ go version
go version go1.11.2 linux/amd64
Most helpful comment
@al3x609 @vsoch
Hello! This change was done by a change in toolset, not anything we set out to do intentionally (it appears).
The
cobrapackage we're using for building subcommands automatically adds the--versionflag to thesingularitycommand. The default format is what you're seeing.We did create a specific command to output the version (
singularity version) that does follow the version convention you all are expecting.Just out of curiosity I've looked through a dozen or so common command-line tools and none of them just print the version and exit. They all have additional text (examples: perl, python, vim, git, bash, homebrew, vagrant, ack, go, etc).
The common choice seems to be ' ', ie 'Vagrant 2.2.0'.
Let's go ahead and lock down a consistent version string output and I will fix things up and add tests so it works as expected in the future.