-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
podman version and --version: fix format, exit #7646
podman version and --version: fix format, exit #7646
Conversation
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>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The third thing you call out was to ensure that |
It does; I tried to mention that in my commit message (EDIT: because it would be a complete showstopper if it didn't)
Um, that doesn't work, nor does it work in released podman. I would consider it a bug if it did work...? |
LGTM |
LGTM |
/lgtm |
/hold cancel |
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