robpike / ivy

ivy, an APL-like calculator
Other
1.33k stars 103 forks source link

print version number #116

Closed smasher164 closed 2 years ago

smasher164 commented 2 years ago

I've been updating the ivy package for the Nix package manager, and when trying to validate that the new binary I had built was working correctly, I noticed there was no way to get the version number from the ivy command.

This isn't strictly necessary since I compared the hash of the previous binary to the current one, but it would be convenient to know from just running ivy -version. Is this something you'd be interested in supporting?

robpike commented 2 years ago

Use the "go version" command, like this:

$ go version -m ./ivy | sed 1q
./ivy: devel go1.20-63d05642d4 Sun Sep 18 01:17:32 2022 +0000
$ 

I could add a version flag, but it's not needed.

smasher164 commented 2 years ago

Makes sense. Thanks!