diff options
Diffstat (limited to 'cmd/podman/pod.go')
-rw-r--r-- | cmd/podman/pod.go | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/cmd/podman/pod.go b/cmd/podman/pod.go index a30361134..c1350bd4d 100644 --- a/cmd/podman/pod.go +++ b/cmd/podman/pod.go @@ -1,35 +1,40 @@ package main import ( - "github.com/urfave/cli" + "github.com/containers/libpod/cmd/podman/cliconfig" + "github.com/spf13/cobra" ) var ( podDescription = `Manage container pods. -Pods are a group of one or more containers sharing the same network, pid and ipc namespaces. -` - podSubCommands = []cli.Command{ - podCreateCommand, - podExistsCommand, - podInspectCommand, - podKillCommand, - podPauseCommand, - podPsCommand, - podRestartCommand, - podRmCommand, - podStartCommand, - podStatsCommand, - podStopCommand, - podTopCommand, - podUnpauseCommand, - } - podCommand = cli.Command{ - Name: "pod", - Usage: "Manage pods", - Description: podDescription, - UseShortOptionHandling: true, - Subcommands: podSubCommands, - OnUsageError: usageErrorHandler, - } +Pods are a group of one or more containers sharing the same network, pid and ipc namespaces.` ) +var podCommand = cliconfig.PodmanCommand{ + Command: &cobra.Command{ + Use: "pod", + Short: "Manage pods", + Long: podDescription, + }, +} + +//podSubCommands are implemented both in local and remote clients +var podSubCommands = []*cobra.Command{ + _podCreateCommand, + _podExistsCommand, + _podInspectCommand, + _podKillCommand, + _podPauseCommand, + _podPsCommand, + _podRestartCommand, + _podRmCommand, + _podStartCommand, + _podStopCommand, + _podUnpauseCommand, +} + +func init() { + podCommand.AddCommand(podSubCommands...) + podCommand.AddCommand(getPodSubCommands()...) + podCommand.SetUsageTemplate(UsageTemplate()) +} |