aboutsummaryrefslogtreecommitdiff
path: root/cmd/kpod
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2017-12-04 10:43:09 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2017-12-04 20:03:16 +0000
commit3db735c6d1bd3fdcf77f4aeed581ae852d79b951 (patch)
treedaad6c759e45b7d316950be9aa57498fecb7a86a /cmd/kpod
parent265efcb9f88a78ee52eb5644d4db86e49788991f (diff)
downloadpodman-3db735c6d1bd3fdcf77f4aeed581ae852d79b951.tar.gz
podman-3db735c6d1bd3fdcf77f4aeed581ae852d79b951.tar.bz2
podman-3db735c6d1bd3fdcf77f4aeed581ae852d79b951.zip
Short options!
Any subcommand that has two or more booleon short options can now combine those two options. For example: kpod rmi -af (Remove all images forceably) Signed-off-by: baude <bbaude@redhat.com> Closes: #100 Approved by: rhatdan
Diffstat (limited to 'cmd/kpod')
-rw-r--r--cmd/kpod/create.go15
-rw-r--r--cmd/kpod/history.go13
-rw-r--r--cmd/kpod/images.go13
-rw-r--r--cmd/kpod/ps.go13
-rw-r--r--cmd/kpod/rm.go9
-rw-r--r--cmd/kpod/rmi.go1
-rw-r--r--cmd/kpod/run.go15
-rw-r--r--cmd/kpod/start.go13
8 files changed, 50 insertions, 42 deletions
diff --git a/cmd/kpod/create.go b/cmd/kpod/create.go
index 9e810af6e..1b340f96d 100644
--- a/cmd/kpod/create.go
+++ b/cmd/kpod/create.go
@@ -131,13 +131,14 @@ var createDescription = "Creates a new container from the given image or" +
" will be created with the initial state 'created'."
var createCommand = cli.Command{
- Name: "create",
- Usage: "create but do not start a container",
- Description: createDescription,
- Flags: createFlags,
- Action: createCmd,
- ArgsUsage: "IMAGE [COMMAND [ARG...]]",
- SkipArgReorder: true,
+ Name: "create",
+ Usage: "create but do not start a container",
+ Description: createDescription,
+ Flags: createFlags,
+ Action: createCmd,
+ ArgsUsage: "IMAGE [COMMAND [ARG...]]",
+ SkipArgReorder: true,
+ UseShortOptionHandling: true,
}
func createCmd(c *cli.Context) error {
diff --git a/cmd/kpod/history.go b/cmd/kpod/history.go
index eba5b8b35..211a843d0 100644
--- a/cmd/kpod/history.go
+++ b/cmd/kpod/history.go
@@ -71,12 +71,13 @@ var (
historyDescription = "Displays the history of an image. The information can be printed out in an easy to read, " +
"or user specified format, and can be truncated."
historyCommand = cli.Command{
- Name: "history",
- Usage: "Show history of a specified image",
- Description: historyDescription,
- Flags: historyFlags,
- Action: historyCmd,
- ArgsUsage: "",
+ Name: "history",
+ Usage: "Show history of a specified image",
+ Description: historyDescription,
+ Flags: historyFlags,
+ Action: historyCmd,
+ ArgsUsage: "",
+ UseShortOptionHandling: true,
}
)
diff --git a/cmd/kpod/images.go b/cmd/kpod/images.go
index 71bc877c9..7b020c984 100644
--- a/cmd/kpod/images.go
+++ b/cmd/kpod/images.go
@@ -72,12 +72,13 @@ var (
imagesDescription = "lists locally stored images."
imagesCommand = cli.Command{
- Name: "images",
- Usage: "list images in local storage",
- Description: imagesDescription,
- Flags: imagesFlags,
- Action: imagesCmd,
- ArgsUsage: "",
+ Name: "images",
+ Usage: "list images in local storage",
+ Description: imagesDescription,
+ Flags: imagesFlags,
+ Action: imagesCmd,
+ ArgsUsage: "",
+ UseShortOptionHandling: true,
}
)
diff --git a/cmd/kpod/ps.go b/cmd/kpod/ps.go
index 13d72429e..2748bea5a 100644
--- a/cmd/kpod/ps.go
+++ b/cmd/kpod/ps.go
@@ -133,12 +133,13 @@ var (
}
psDescription = "Prints out information about the containers"
psCommand = cli.Command{
- Name: "ps",
- Usage: "List containers",
- Description: psDescription,
- Flags: psFlags,
- Action: psCmd,
- ArgsUsage: "",
+ Name: "ps",
+ Usage: "List containers",
+ Description: psDescription,
+ Flags: psFlags,
+ Action: psCmd,
+ ArgsUsage: "",
+ UseShortOptionHandling: true,
}
)
diff --git a/cmd/kpod/rm.go b/cmd/kpod/rm.go
index 511679770..2f767457f 100644
--- a/cmd/kpod/rm.go
+++ b/cmd/kpod/rm.go
@@ -25,10 +25,11 @@ var (
Name: "rm",
Usage: fmt.Sprintf(`kpod rm will remove one or more containers from the host. The container name or ID can be used.
This does not remove images. Running containers will not be removed without the -f option.`),
- Description: rmDescription,
- Flags: rmFlags,
- Action: rmCmd,
- ArgsUsage: "",
+ Description: rmDescription,
+ Flags: rmFlags,
+ Action: rmCmd,
+ ArgsUsage: "",
+ UseShortOptionHandling: true,
}
)
diff --git a/cmd/kpod/rmi.go b/cmd/kpod/rmi.go
index b69b3b514..1b4cb7390 100644
--- a/cmd/kpod/rmi.go
+++ b/cmd/kpod/rmi.go
@@ -27,6 +27,7 @@ var (
Action: rmiCmd,
ArgsUsage: "IMAGE-NAME-OR-ID [...]",
Flags: rmiFlags,
+ UseShortOptionHandling: true,
}
)
diff --git a/cmd/kpod/run.go b/cmd/kpod/run.go
index eb3dee88c..934096c21 100644
--- a/cmd/kpod/run.go
+++ b/cmd/kpod/run.go
@@ -13,13 +13,14 @@ import (
var runDescription = "Runs a command in a new container from the given image"
var runCommand = cli.Command{
- Name: "run",
- Usage: "run a command in a new container",
- Description: runDescription,
- Flags: createFlags,
- Action: runCmd,
- ArgsUsage: "IMAGE [COMMAND [ARG...]]",
- SkipArgReorder: true,
+ Name: "run",
+ Usage: "run a command in a new container",
+ Description: runDescription,
+ Flags: createFlags,
+ Action: runCmd,
+ ArgsUsage: "IMAGE [COMMAND [ARG...]]",
+ SkipArgReorder: true,
+ UseShortOptionHandling: true,
}
func runCmd(c *cli.Context) error {
diff --git a/cmd/kpod/start.go b/cmd/kpod/start.go
index fcc4c9736..c874c541c 100644
--- a/cmd/kpod/start.go
+++ b/cmd/kpod/start.go
@@ -34,12 +34,13 @@ var (
`
startCommand = cli.Command{
- Name: "start",
- Usage: "Start one or more containers",
- Description: startDescription,
- Flags: startFlags,
- Action: startCmd,
- ArgsUsage: "CONTAINER-NAME [CONTAINER-NAME ...]",
+ Name: "start",
+ Usage: "Start one or more containers",
+ Description: startDescription,
+ Flags: startFlags,
+ Action: startCmd,
+ ArgsUsage: "CONTAINER-NAME [CONTAINER-NAME ...]",
+ UseShortOptionHandling: true,
}
)