Implement --version and --help flags
Closed this issue · 1 comments
remi commented
I wanted to make sure I was using the latest version of nv
so I ran this:
# Current
$ nv --version
nv 2.1.0(2021-06-02) — context specific environment variables
Usage: nv <env files> <command> [arguments...]
$ echo $?
255
The error message (because --version
is not a supported flag) output prints the version number by default but it would be nice to have a proper --version
flag that would output the version number and then exit with a 0
status, eg.
# Suggestion
$ nv --version
nv 2.1.0(2021-06-02)
$ echo $?
0
Same thing for --help
:
# Current
$ nv --help
nv 2.1.0(2021-06-02) — context specific environment variables
Usage: nv <env files> <command> [arguments...]
$ echo $?
255
The usage is printed but again, as an error message. This would be nice:
# Suggestion
$ nv --help
Usage: nv <env files> <command> [arguments...]
$ echo $?
0
Cheers! ✌️
jcouture commented
Thanks for the suggestions.
I will look into it soon.