podmanv2 add pre-run to each commmand

each container command needs a prerune because it is not part of the containers subcommand yet

Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
Brent Baude
2020-03-25 19:19:55 -05:00
parent ff0124aee1
commit 06e2a5dd86
7 changed files with 35 additions and 28 deletions

View File

@ -19,6 +19,7 @@ var (
Short: "Kill one or more running containers with a specific signal",
Long: killDescription,
RunE: kill,
PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
},

View File

@ -19,6 +19,7 @@ var (
Short: "Pause all the processes in one or more containers",
Long: pauseDescription,
RunE: pause,
PersistentPreRunE: preRunE,
Example: `podman pause mywebserver
podman pause 860a4b23
podman pause -a`,

View File

@ -22,6 +22,7 @@ var (
Short: "Restart one or more containers",
Long: restartDescription,
RunE: restart,
PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
},

View File

@ -23,6 +23,7 @@ var (
Short: "Remove one or more containers",
Long: rmDescription,
RunE: rm,
PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, true)
},

View File

@ -22,6 +22,7 @@ var (
Short: "Stop one or more containers",
Long: stopDescription,
RunE: stop,
PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, true)
},

View File

@ -19,6 +19,7 @@ var (
Short: "Unpause the processes in one or more containers",
Long: unpauseDescription,
RunE: unpause,
PersistentPreRunE: preRunE,
Example: `podman unpause ctrID
podman unpause --all`,
}

View File

@ -22,6 +22,7 @@ var (
Short: "Block on one or more containers",
Long: waitDescription,
RunE: wait,
PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
},