-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
bugCommander is not working as intendedCommander is not working as intended
Description
According to the docs, only "my-cmd --version" should output the version number, but I have found that commander also picks up the string 'version' anywhere in the arguments.
As an example of where this causes problems, you can have a look at a little utility I wrote called pick_json. It is used it to extract fields from json on stdin.
$ echo '{ "name" : "myapp", "version" : "3.4.5" }' > appinfo.json
$ pick_json name < appinfo.json
myapp
$ pick_json version < appinfo.json #WTF moment
1.1.2
$ pick_json --version
1.1.2
As you can see, instead of picking the version field from the json, it shows the version number of pick_json. This is not inline with the docs.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugCommander is not working as intendedCommander is not working as intended