-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add short version flag -v when not otherwise set #996
Add short version flag -v when not otherwise set #996
Conversation
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
@eparis would you mind having a look at this? |
ping @jharshman, maybe? |
Thanks @jharshman! Can this be merged? Or does it need more approvals? |
@jharshman @bep @eparis @broady I wonder if one of you could please merge this? |
@hairyhenderson - yes, I was just giving it another once over. |
Thanks @jharshman, I appreciate it! |
@jharshman any possibility of getting a v0.0.7 cut? No rush - until then I can just use |
Three unrelated fixes to version output: * podman version --format json: was missing a newline * podman version --format TEMPLATE: had too many newlines * podman --version: would neither display version nor exit if followed by a subcommand ('podman --version ps') The first two were easy: I used my best tweezers to delicately pluck and transfer the misplaced \n and place it where needed. The third was a doozy of a rabbit hole. As best I can tell, a workaround was added in root.go to override cobra's built-in Version handling, apparently to avoid having cobra add "-v" as an alias for "--version". As best I can tell, cobra only does this if the "-v" shortcut is not already taken (at least as of Nov 2019: spf13/cobra#996 ). Also as best I can tell that workaround is purely vestigial, and removing it is safe. I've manually tested "-v" in podman run, system df, and rm. I've run system tests. Signed-off-by: Ed Santiago <santiago@redhat.com>
Fixes #654 by adding a
-v
shorthand to the automatically-addedversion
flag.-v
shorthand is already set--version
flag is already setSigned-off-by: Dave Henderson dhenderson@gmail.com