diff options
Diffstat (limited to 'cmd/podman/cliconfig')
-rw-r--r-- | cmd/podman/cliconfig/commands.go | 36 | ||||
-rw-r--r-- | cmd/podman/cliconfig/config.go | 1 |
2 files changed, 28 insertions, 9 deletions
diff --git a/cmd/podman/cliconfig/commands.go b/cmd/podman/cliconfig/commands.go index 00b66e32a..f6d92611f 100644 --- a/cmd/podman/cliconfig/commands.go +++ b/cmd/podman/cliconfig/commands.go @@ -26,7 +26,9 @@ func (p *PodmanCommand) IsSet(opt string) bool { func (p *PodmanCommand) Bool(opt string) bool { flag := p.Flags().Lookup(opt) if flag == nil { - logrus.Errorf("Could not find flag %s", opt) + if !p.Remote { + logrus.Errorf("Could not find flag %s", opt) + } return false } val, err := p.Flags().GetBool(opt) @@ -40,7 +42,9 @@ func (p *PodmanCommand) Bool(opt string) bool { func (p *PodmanCommand) String(opt string) string { flag := p.Flags().Lookup(opt) if flag == nil { - logrus.Errorf("Could not find flag %s", opt) + if !p.Remote { + logrus.Errorf("Could not find flag %s", opt) + } return "" } val, err := p.Flags().GetString(opt) @@ -54,7 +58,9 @@ func (p *PodmanCommand) String(opt string) string { func (p *PodmanCommand) StringArray(opt string) []string { flag := p.Flags().Lookup(opt) if flag == nil { - logrus.Errorf("Could not find flag %s", opt) + if !p.Remote { + logrus.Errorf("Could not find flag %s", opt) + } return []string{} } val, err := p.Flags().GetStringArray(opt) @@ -68,7 +74,9 @@ func (p *PodmanCommand) StringArray(opt string) []string { func (p *PodmanCommand) StringSlice(opt string) []string { flag := p.Flags().Lookup(opt) if flag == nil { - logrus.Errorf("Could not find flag %s", opt) + if !p.Remote { + logrus.Errorf("Could not find flag %s", opt) + } return []string{} } val, err := p.Flags().GetStringSlice(opt) @@ -82,7 +90,9 @@ func (p *PodmanCommand) StringSlice(opt string) []string { func (p *PodmanCommand) Int(opt string) int { flag := p.Flags().Lookup(opt) if flag == nil { - logrus.Errorf("Could not find flag %s", opt) + if !p.Remote { + logrus.Errorf("Could not find flag %s", opt) + } return 0 } val, err := p.Flags().GetInt(opt) @@ -96,7 +106,9 @@ func (p *PodmanCommand) Int(opt string) int { func (p *PodmanCommand) Uint(opt string) uint { flag := p.Flags().Lookup(opt) if flag == nil { - logrus.Errorf("Could not find flag %s", opt) + if !p.Remote { + logrus.Errorf("Could not find flag %s", opt) + } return 0 } val, err := p.Flags().GetUint(opt) @@ -110,7 +122,9 @@ func (p *PodmanCommand) Uint(opt string) uint { func (p *PodmanCommand) Int64(opt string) int64 { flag := p.Flags().Lookup(opt) if flag == nil { - logrus.Errorf("Could not find flag %s", opt) + if !p.Remote { + logrus.Errorf("Could not find flag %s", opt) + } return 0 } val, err := p.Flags().GetInt64(opt) @@ -124,7 +138,9 @@ func (p *PodmanCommand) Int64(opt string) int64 { func (p *PodmanCommand) Uint64(opt string) uint64 { flag := p.Flags().Lookup(opt) if flag == nil { - logrus.Errorf("Could not find flag %s", opt) + if !p.Remote { + logrus.Errorf("Could not find flag %s", opt) + } return 0 } val, err := p.Flags().GetUint64(opt) @@ -138,7 +154,9 @@ func (p *PodmanCommand) Uint64(opt string) uint64 { func (p *PodmanCommand) Float64(opt string) float64 { flag := p.Flags().Lookup(opt) if flag == nil { - logrus.Errorf("Could not find flag %s", opt) + if !p.Remote { + logrus.Errorf("Could not find flag %s", opt) + } return 0 } val, err := p.Flags().GetFloat64(opt) diff --git a/cmd/podman/cliconfig/config.go b/cmd/podman/cliconfig/config.go index 2692ace36..982c77c17 100644 --- a/cmd/podman/cliconfig/config.go +++ b/cmd/podman/cliconfig/config.go @@ -8,6 +8,7 @@ type PodmanCommand struct { *cobra.Command InputArgs []string GlobalFlags MainFlags + Remote bool } type MainFlags struct { |