summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-02-28 10:41:01 -0800
committerGitHub <noreply@github.com>2019-02-28 10:41:01 -0800
commit4a109a71996e99c9a95b639bbbee1c5e30450c97 (patch)
treefe250e7ef427ece689847c5c88094a9f3069308e /cmd/podman
parent2e463b7720769d85dcdae516cad96c57e96b7464 (diff)
parent3fa1fdf7117dbe4a114ddf9c4e7155cbb9ce2fed (diff)
downloadpodman-4a109a71996e99c9a95b639bbbee1c5e30450c97.tar.gz
podman-4a109a71996e99c9a95b639bbbee1c5e30450c97.tar.bz2
podman-4a109a71996e99c9a95b639bbbee1c5e30450c97.zip
Merge pull request #2480 from baude/clifixups
fix up a number of misplace commands
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/commands.go8
-rw-r--r--cmd/podman/container.go2
-rw-r--r--cmd/podman/image.go9
-rw-r--r--cmd/podman/main.go2
-rw-r--r--cmd/podman/ps.go4
-rw-r--r--cmd/podman/rmi.go4
6 files changed, 20 insertions, 9 deletions
diff --git a/cmd/podman/commands.go b/cmd/podman/commands.go
index fd36e77d5..2f9a9cfe2 100644
--- a/cmd/podman/commands.go
+++ b/cmd/podman/commands.go
@@ -18,7 +18,7 @@ func getMainCommands() []*cobra.Command {
_execCommand,
_generateCommand,
_playCommand,
- _psCommand,
+ &_psCommand,
_loginCommand,
_logoutCommand,
_logsCommand,
@@ -54,6 +54,10 @@ func getImageSubCommands() []*cobra.Command {
// Commands that the local client implements
func getContainerSubCommands() []*cobra.Command {
+
+ var _listSubCommand = _psCommand
+ _listSubCommand.Use = "list"
+
return []*cobra.Command{
_attachCommand,
_checkpointCommand,
@@ -64,8 +68,8 @@ func getContainerSubCommands() []*cobra.Command {
_execCommand,
_exportCommand,
_killCommand,
+ &_listSubCommand,
_logsCommand,
- _psCommand,
_mountCommand,
_pauseCommand,
_portCommand,
diff --git a/cmd/podman/container.go b/cmd/podman/container.go
index d2450fdd3..338bb005c 100644
--- a/cmd/podman/container.go
+++ b/cmd/podman/container.go
@@ -18,11 +18,13 @@ var containerCommand = cliconfig.PodmanCommand{
// Commands that are universally implemented.
var containerCommands = []*cobra.Command{
_containerExistsCommand,
+ _inspectCommand,
}
func init() {
containerCommand.AddCommand(containerCommands...)
containerCommand.AddCommand(getContainerSubCommands()...)
containerCommand.SetUsageTemplate(UsageTemplate())
+
rootCmd.AddCommand(containerCommand.Command)
}
diff --git a/cmd/podman/image.go b/cmd/podman/image.go
index aaa1866c4..b5c1c3ccf 100644
--- a/cmd/podman/image.go
+++ b/cmd/podman/image.go
@@ -15,6 +15,7 @@ var (
},
}
_imagesSubCommand = _imagesCommand
+ _rmSubCommand = _rmiCommand
)
//imageSubCommands are implemented both in local and remote clients
@@ -28,7 +29,6 @@ var imageSubCommands = []*cobra.Command{
_pruneImagesCommand,
_pullCommand,
_pushCommand,
- _rmiCommand,
_saveCommand,
_tagCommand,
}
@@ -38,7 +38,12 @@ func init() {
imageCommand.AddCommand(imageSubCommands...)
imageCommand.AddCommand(getImageSubCommands()...)
- _imagesSubCommand.Aliases = []string{"ls", "list"}
+ // Setup of "images" to appear as "list"
+ _imagesSubCommand.Use = "list"
+ _imagesSubCommand.Aliases = []string{"ls"}
imageCommand.AddCommand(&_imagesSubCommand)
+ // Setup of "rmi" to appears as "rm"
+ _rmSubCommand.Use = "rm"
+ imageCommand.AddCommand(&_rmSubCommand)
}
diff --git a/cmd/podman/main.go b/cmd/podman/main.go
index d36270853..98e2f23ca 100644
--- a/cmd/podman/main.go
+++ b/cmd/podman/main.go
@@ -47,7 +47,7 @@ var mainCommands = []*cobra.Command{
podCommand.Command,
_pullCommand,
_pushCommand,
- _rmiCommand,
+ &_rmiCommand,
_saveCommand,
_tagCommand,
_versionCommand,
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index 3bc4f0b08..fe4173fdd 100644
--- a/cmd/podman/ps.go
+++ b/cmd/podman/ps.go
@@ -157,7 +157,7 @@ func (a psSortedSize) Less(i, j int) bool {
var (
psCommand cliconfig.PsValues
psDescription = "Prints out information about the containers"
- _psCommand = &cobra.Command{
+ _psCommand = cobra.Command{
Use: "ps",
Short: "List containers",
Long: psDescription,
@@ -173,7 +173,7 @@ var (
)
func init() {
- psCommand.Command = _psCommand
+ psCommand.Command = &_psCommand
psCommand.SetUsageTemplate(UsageTemplate())
flags := psCommand.Flags()
flags.BoolVarP(&psCommand.All, "all", "a", false, "Show all the containers, default is only running containers")
diff --git a/cmd/podman/rmi.go b/cmd/podman/rmi.go
index e5bb9b486..5b8bf1ea3 100644
--- a/cmd/podman/rmi.go
+++ b/cmd/podman/rmi.go
@@ -14,7 +14,7 @@ import (
var (
rmiCommand cliconfig.RmiValues
rmiDescription = "Removes one or more locally stored images."
- _rmiCommand = &cobra.Command{
+ _rmiCommand = cobra.Command{
Use: "rmi [flags] IMAGE [IMAGE...]",
Short: "Removes one or more images from local storage",
Long: rmiDescription,
@@ -30,7 +30,7 @@ var (
)
func init() {
- rmiCommand.Command = _rmiCommand
+ rmiCommand.Command = &_rmiCommand
rmiCommand.SetUsageTemplate(UsageTemplate())
flags := rmiCommand.Flags()
flags.BoolVarP(&rmiCommand.All, "all", "a", false, "Remove all images")