proper --debug/-D flag support
--debug should not be a global flag, you can only use this as podman
--debug never podman ps --debug. This matches docker and allows us to
add the shorthand "D" since they now no longer conflict.
Fixes changes from commit 2d30b4dee5
which claims to add -D but never
did.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
7946628734
commit
8d40bf3f14
|
@ -475,8 +475,8 @@ func rootFlags(cmd *cobra.Command, opts *entities.PodmanConfig) {
|
|||
pFlags.StringVar(&logLevel, logLevelFlagName, logLevel, fmt.Sprintf("Log messages above specified level (%s)", strings.Join(common.LogLevels, ", ")))
|
||||
_ = rootCmd.RegisterFlagCompletionFunc(logLevelFlagName, common.AutocompleteLogLevel)
|
||||
|
||||
pFlags.BoolVar(&debug, "debug", false, "Docker compatibility, force setting of log-level")
|
||||
_ = pFlags.MarkHidden("debug")
|
||||
lFlags.BoolVarP(&debug, "debug", "D", false, "Docker compatibility, force setting of log-level")
|
||||
_ = lFlags.MarkHidden("debug")
|
||||
|
||||
// Only create these flags for ABI connections
|
||||
if !registry.IsRemote() {
|
||||
|
|
|
@ -190,7 +190,9 @@ See 'podman version --help'" "podman version --remote"
|
|||
run_podman --log-level=error info
|
||||
run_podman --log-level=fatal info
|
||||
run_podman --log-level=panic info
|
||||
# docker compat
|
||||
run_podman --debug info
|
||||
run_podman -D info
|
||||
run_podman 1 --debug --log-level=panic info
|
||||
is "$output" "Setting --log-level and --debug is not allowed"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue