diff options
author | Brent Baude <bbaude@redhat.com> | 2020-04-16 12:25:26 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-04-16 15:53:58 -0500 |
commit | 241326a9a8c20ad7f2bcf651416b836e7778e090 (patch) | |
tree | 4001e8e47a022bb1b9bfbf2332c42e1aeb802f9e /cmd/podman/cliconfig/commands.go | |
parent | 88c6fd06cd54fb9a8826306dfdf1a77e400de5de (diff) | |
download | podman-241326a9a8c20ad7f2bcf651416b836e7778e090.tar.gz podman-241326a9a8c20ad7f2bcf651416b836e7778e090.tar.bz2 podman-241326a9a8c20ad7f2bcf651416b836e7778e090.zip |
Podman V2 birth
remote podman v1 and replace with podman v2.
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/cliconfig/commands.go')
-rw-r--r-- | cmd/podman/cliconfig/commands.go | 167 |
1 files changed, 0 insertions, 167 deletions
diff --git a/cmd/podman/cliconfig/commands.go b/cmd/podman/cliconfig/commands.go deleted file mode 100644 index f6d92611f..000000000 --- a/cmd/podman/cliconfig/commands.go +++ /dev/null @@ -1,167 +0,0 @@ -package cliconfig - -import ( - "github.com/sirupsen/logrus" -) - -// GlobalIsSet is a compatibility method for urfave -func (p *PodmanCommand) GlobalIsSet(opt string) bool { - flag := p.PersistentFlags().Lookup(opt) - if flag == nil { - return false - } - return flag.Changed -} - -// IsSet is a compatibility method for urfave -func (p *PodmanCommand) IsSet(opt string) bool { - flag := p.Flags().Lookup(opt) - if flag == nil { - return false - } - return flag.Changed -} - -// Bool is a compatibility method for urfave -func (p *PodmanCommand) Bool(opt string) bool { - flag := p.Flags().Lookup(opt) - if flag == nil { - if !p.Remote { - logrus.Errorf("Could not find flag %s", opt) - } - return false - } - val, err := p.Flags().GetBool(opt) - if err != nil { - logrus.Errorf("Error getting flag %s: %v", opt, err) - } - return val -} - -// String is a compatibility method for urfave -func (p *PodmanCommand) String(opt string) string { - flag := p.Flags().Lookup(opt) - if flag == nil { - if !p.Remote { - logrus.Errorf("Could not find flag %s", opt) - } - return "" - } - val, err := p.Flags().GetString(opt) - if err != nil { - logrus.Errorf("Error getting flag %s: %v", opt, err) - } - return val -} - -// StringArray is a compatibility method for urfave -func (p *PodmanCommand) StringArray(opt string) []string { - flag := p.Flags().Lookup(opt) - if flag == nil { - if !p.Remote { - logrus.Errorf("Could not find flag %s", opt) - } - return []string{} - } - val, err := p.Flags().GetStringArray(opt) - if err != nil { - logrus.Errorf("Error getting flag %s: %v", opt, err) - } - return val -} - -// StringSlice is a compatibility method for urfave -func (p *PodmanCommand) StringSlice(opt string) []string { - flag := p.Flags().Lookup(opt) - if flag == nil { - if !p.Remote { - logrus.Errorf("Could not find flag %s", opt) - } - return []string{} - } - val, err := p.Flags().GetStringSlice(opt) - if err != nil { - logrus.Errorf("Error getting flag %s: %v", opt, err) - } - return val -} - -// Int is a compatibility method for urfave -func (p *PodmanCommand) Int(opt string) int { - flag := p.Flags().Lookup(opt) - if flag == nil { - if !p.Remote { - logrus.Errorf("Could not find flag %s", opt) - } - return 0 - } - val, err := p.Flags().GetInt(opt) - if err != nil { - logrus.Errorf("Error getting flag %s: %v", opt, err) - } - return val -} - -// Unt is a compatibility method for urfave -func (p *PodmanCommand) Uint(opt string) uint { - flag := p.Flags().Lookup(opt) - if flag == nil { - if !p.Remote { - logrus.Errorf("Could not find flag %s", opt) - } - return 0 - } - val, err := p.Flags().GetUint(opt) - if err != nil { - logrus.Errorf("Error getting flag %s: %v", opt, err) - } - return val -} - -// Int64 is a compatibility method for urfave -func (p *PodmanCommand) Int64(opt string) int64 { - flag := p.Flags().Lookup(opt) - if flag == nil { - if !p.Remote { - logrus.Errorf("Could not find flag %s", opt) - } - return 0 - } - val, err := p.Flags().GetInt64(opt) - if err != nil { - logrus.Errorf("Error getting flag %s: %v", opt, err) - } - return val -} - -// Unt64 is a compatibility method for urfave -func (p *PodmanCommand) Uint64(opt string) uint64 { - flag := p.Flags().Lookup(opt) - if flag == nil { - if !p.Remote { - logrus.Errorf("Could not find flag %s", opt) - } - return 0 - } - val, err := p.Flags().GetUint64(opt) - if err != nil { - logrus.Errorf("Error getting flag %s: %v", opt, err) - } - return val -} - -// Float64 is a compatibility method for urfave -func (p *PodmanCommand) Float64(opt string) float64 { - flag := p.Flags().Lookup(opt) - if flag == nil { - if !p.Remote { - logrus.Errorf("Could not find flag %s", opt) - } - return 0 - } - val, err := p.Flags().GetFloat64(opt) - if err != nil { - logrus.Errorf("Error getting flag %s: %v", opt, err) - } - return val -} |