summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/checkpoint.go6
-rw-r--r--cmd/podman/commands.go2
-rw-r--r--cmd/podman/create.go2
-rw-r--r--cmd/podman/exists.go9
-rw-r--r--cmd/podman/generate_kube.go2
-rw-r--r--cmd/podman/image.go6
-rw-r--r--cmd/podman/images.go7
-rw-r--r--cmd/podman/main.go2
-rw-r--r--cmd/podman/ps.go7
-rw-r--r--cmd/podman/rmi.go19
-rw-r--r--cmd/podman/trust_set_show.go4
11 files changed, 29 insertions, 37 deletions
diff --git a/cmd/podman/checkpoint.go b/cmd/podman/checkpoint.go
index 8c4b8ad3c..367065766 100644
--- a/cmd/podman/checkpoint.go
+++ b/cmd/podman/checkpoint.go
@@ -32,9 +32,9 @@ var (
Args: func(cmd *cobra.Command, args []string) error {
return checkAllAndLatest(cmd, args, false)
},
- Example: `podman checkpoint --keep ctrID
- podman checkpoint --all
- podman checkpoint --leave-running --latest`,
+ Example: `podman container checkpoint --keep ctrID
+ podman container checkpoint --all
+ podman container checkpoint --leave-running --latest`,
}
)
diff --git a/cmd/podman/commands.go b/cmd/podman/commands.go
index 73e02e27a..fd36e77d5 100644
--- a/cmd/podman/commands.go
+++ b/cmd/podman/commands.go
@@ -30,7 +30,6 @@ func getMainCommands() []*cobra.Command {
_rmCommand,
_runCommand,
_searchCommand,
- _signCommand,
_startCommand,
_statsCommand,
_stopCommand,
@@ -49,7 +48,6 @@ func getMainCommands() []*cobra.Command {
// Commands that the local client implements
func getImageSubCommands() []*cobra.Command {
return []*cobra.Command{
- _loadCommand,
_signCommand,
}
}
diff --git a/cmd/podman/create.go b/cmd/podman/create.go
index e8746dfa3..95cb732d9 100644
--- a/cmd/podman/create.go
+++ b/cmd/podman/create.go
@@ -67,7 +67,7 @@ func init() {
getCreateFlags(&createCommand.PodmanCommand)
flags := createCommand.Flags()
- flags.SetInterspersed(true)
+ flags.SetInterspersed(false)
}
diff --git a/cmd/podman/exists.go b/cmd/podman/exists.go
index c01a6a081..109831e74 100644
--- a/cmd/podman/exists.go
+++ b/cmd/podman/exists.go
@@ -40,7 +40,8 @@ var (
imageExistsCommand.GlobalFlags = MainGlobalOpts
return imageExistsCmd(&imageExistsCommand)
},
- Example: `podman image exists imageID`,
+ Example: `podman image exists imageID
+ podman image exists alpine || podman pull alpine`,
}
_containerExistsCommand = &cobra.Command{
@@ -53,7 +54,8 @@ var (
return containerExistsCmd(&containerExistsCommand)
},
- Example: `podman container exists containerID`,
+ Example: `podman container exists containerID
+ podman container exists myctr || podman run --name myctr [etc...]`,
}
_podExistsCommand = &cobra.Command{
@@ -65,7 +67,8 @@ var (
podExistsCommand.GlobalFlags = MainGlobalOpts
return podExistsCmd(&podExistsCommand)
},
- Example: `podman pod exists podID`,
+ Example: `podman pod exists podID
+ podman pod exists mypod || podman pod create --name mypod`,
}
)
diff --git a/cmd/podman/generate_kube.go b/cmd/podman/generate_kube.go
index 090f99495..fa2872b77 100644
--- a/cmd/podman/generate_kube.go
+++ b/cmd/podman/generate_kube.go
@@ -17,7 +17,7 @@ var (
containerKubeCommand cliconfig.GenerateKubeValues
containerKubeDescription = "Generate Kubernetes Pod YAML"
_containerKubeCommand = &cobra.Command{
- Use: "kube CONTAINER | POD",
+ Use: "kube [flags] CONTAINER | POD",
Short: "Generate Kubernetes pod YAML for a container or pod",
Long: containerKubeDescription,
RunE: func(cmd *cobra.Command, args []string) error {
diff --git a/cmd/podman/image.go b/cmd/podman/image.go
index 14053cb0d..aaa1866c4 100644
--- a/cmd/podman/image.go
+++ b/cmd/podman/image.go
@@ -14,6 +14,7 @@ var (
Long: imageDescription,
},
}
+ _imagesSubCommand = _imagesCommand
)
//imageSubCommands are implemented both in local and remote clients
@@ -21,7 +22,6 @@ var imageSubCommands = []*cobra.Command{
_buildCommand,
_historyCommand,
_imageExistsCommand,
- _imagesCommand,
_importCommand,
_inspectCommand,
_loadCommand,
@@ -37,4 +37,8 @@ func init() {
imageCommand.SetUsageTemplate(UsageTemplate())
imageCommand.AddCommand(imageSubCommands...)
imageCommand.AddCommand(getImageSubCommands()...)
+
+ _imagesSubCommand.Aliases = []string{"ls", "list"}
+ imageCommand.AddCommand(&_imagesSubCommand)
+
}
diff --git a/cmd/podman/images.go b/cmd/podman/images.go
index 6e82195a9..e6f4d9a60 100644
--- a/cmd/podman/images.go
+++ b/cmd/podman/images.go
@@ -87,8 +87,8 @@ var (
imagesCommand cliconfig.ImagesValues
imagesDescription = "lists locally stored images."
- _imagesCommand = &cobra.Command{
- Use: "images",
+ _imagesCommand = cobra.Command{
+ Use: "images [flags] [IMAGE]",
Short: "List images in local storage",
Long: imagesDescription,
RunE: func(cmd *cobra.Command, args []string) error {
@@ -103,8 +103,9 @@ var (
)
func init() {
- imagesCommand.Command = _imagesCommand
+ imagesCommand.Command = &_imagesCommand
imagesCommand.SetUsageTemplate(UsageTemplate())
+
flags := imagesCommand.Flags()
flags.BoolVarP(&imagesCommand.All, "all", "a", false, "Show all images (default hides intermediate images)")
flags.BoolVar(&imagesCommand.Digests, "digests", false, "Show digests")
diff --git a/cmd/podman/main.go b/cmd/podman/main.go
index 19bdb40d6..d36270853 100644
--- a/cmd/podman/main.go
+++ b/cmd/podman/main.go
@@ -38,7 +38,7 @@ var mainCommands = []*cobra.Command{
_buildCommand,
_exportCommand,
_historyCommand,
- _imagesCommand,
+ &_imagesCommand,
_importCommand,
_infoCommand,
_inspectCommand,
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index 9c165b836..3bc4f0b08 100644
--- a/cmd/podman/ps.go
+++ b/cmd/podman/ps.go
@@ -158,10 +158,9 @@ var (
psCommand cliconfig.PsValues
psDescription = "Prints out information about the containers"
_psCommand = &cobra.Command{
- Use: "list",
- Aliases: []string{"ls", "ps"},
- Short: "List containers",
- Long: psDescription,
+ Use: "ps",
+ Short: "List containers",
+ Long: psDescription,
RunE: func(cmd *cobra.Command, args []string) error {
psCommand.InputArgs = args
psCommand.GlobalFlags = MainGlobalOpts
diff --git a/cmd/podman/rmi.go b/cmd/podman/rmi.go
index 0963b1328..e5bb9b486 100644
--- a/cmd/podman/rmi.go
+++ b/cmd/podman/rmi.go
@@ -5,8 +5,6 @@ import (
"os"
"github.com/containers/libpod/cmd/podman/cliconfig"
- "github.com/containers/libpod/cmd/podman/varlink"
- "github.com/containers/libpod/libpod/image"
"github.com/containers/libpod/pkg/adapter"
"github.com/containers/storage"
"github.com/pkg/errors"
@@ -31,17 +29,6 @@ var (
}
)
-func imageNotFound(err error) bool {
- if errors.Cause(err) == image.ErrNoSuchImage {
- return true
- }
- switch err.(type) {
- case *iopodman.ImageNotFound:
- return true
- }
- return false
-}
-
func init() {
rmiCommand.Command = _rmiCommand
rmiCommand.SetUsageTemplate(UsageTemplate())
@@ -80,7 +67,7 @@ func rmiCmd(c *cliconfig.RmiValues) error {
if errors.Cause(err) == storage.ErrImageUsedByContainer {
fmt.Printf("A container associated with containers/storage, i.e. via Buildah, CRI-O, etc., may be associated with this image: %-12.12s\n", img.ID())
}
- if !imageNotFound(err) {
+ if !adapter.IsImageNotFound(err) {
failureCnt++
}
if lastError != nil {
@@ -135,7 +122,7 @@ func rmiCmd(c *cliconfig.RmiValues) error {
newImage, err := runtime.NewImageFromLocal(i)
if err != nil {
if lastError != nil {
- if !imageNotFound(lastError) {
+ if !adapter.IsImageNotFound(lastError) {
failureCnt++
}
fmt.Fprintln(os.Stderr, lastError)
@@ -147,7 +134,7 @@ func rmiCmd(c *cliconfig.RmiValues) error {
}
}
- if imageNotFound(lastError) && failureCnt == 0 {
+ if adapter.IsImageNotFound(lastError) && failureCnt == 0 {
exitCode = 1
}
diff --git a/cmd/podman/trust_set_show.go b/cmd/podman/trust_set_show.go
index 0a4783d0a..746854249 100644
--- a/cmd/podman/trust_set_show.go
+++ b/cmd/podman/trust_set_show.go
@@ -23,7 +23,7 @@ var (
showTrustCommand cliconfig.ShowTrustValues
setTrustDescription = "Set default trust policy or add a new trust policy for a registry"
_setTrustCommand = &cobra.Command{
- Use: "set",
+ Use: "set [flags] REGISTRY",
Short: "Set default trust policy or a new trust policy for a registry",
Long: setTrustDescription,
Example: "",
@@ -36,7 +36,7 @@ var (
showTrustDescription = "Display trust policy for the system"
_showTrustCommand = &cobra.Command{
- Use: "show",
+ Use: "show [flags] [REGISTRY]",
Short: "Display trust policy for the system",
Long: showTrustDescription,
RunE: func(cmd *cobra.Command, args []string) error {