diff options
author | Jhon Honce <jhonce@redhat.com> | 2020-03-25 14:00:31 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2020-03-25 17:54:14 -0700 |
commit | f38a26bfa0621e06ad8401ded3e10d7ea834819e (patch) | |
tree | c43a0f48f6ce8e8a4e1105399c7ba77745bb3be8 /cmd/podmanV2/images/rmi.go | |
parent | 36a4cc864d1de57cd822a81d01f0b5f1b40eaa7d (diff) | |
download | podman-f38a26bfa0621e06ad8401ded3e10d7ea834819e.tar.gz podman-f38a26bfa0621e06ad8401ded3e10d7ea834819e.tar.bz2 podman-f38a26bfa0621e06ad8401ded3e10d7ea834819e.zip |
V2 podman image rm | podman rmi [IMAGE]
* Add support for rm and rmi commands
* Support for registry.ExitCode
* Support for N-errors from domain layer
* Add log-level support
* Add syslog support
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'cmd/podmanV2/images/rmi.go')
-rw-r--r-- | cmd/podmanV2/images/rmi.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/cmd/podmanV2/images/rmi.go b/cmd/podmanV2/images/rmi.go new file mode 100644 index 000000000..7f9297bc9 --- /dev/null +++ b/cmd/podmanV2/images/rmi.go @@ -0,0 +1,30 @@ +package images + +import ( + "strings" + + "github.com/containers/libpod/cmd/podmanV2/registry" + "github.com/containers/libpod/pkg/domain/entities" + "github.com/spf13/cobra" +) + +var ( + rmiCmd = &cobra.Command{ + Use: strings.Replace(rmCmd.Use, "rm ", "rmi ", 1), + Args: rmCmd.Args, + Short: rmCmd.Short, + Long: rmCmd.Long, + PreRunE: rmCmd.PreRunE, + RunE: rmCmd.RunE, + Example: strings.Replace(rmCmd.Example, "podman image rm", "podman rmi", -1), + } +) + +func init() { + registry.Commands = append(registry.Commands, registry.CliCommand{ + Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, + Command: rmiCmd, + }) + rmiCmd.SetHelpTemplate(registry.HelpTemplate()) + rmiCmd.SetUsageTemplate(registry.UsageTemplate()) +} |