summaryrefslogtreecommitdiff
path: root/cmd/podman/container.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/container.go')
-rw-r--r--cmd/podman/container.go37
1 files changed, 14 insertions, 23 deletions
diff --git a/cmd/podman/container.go b/cmd/podman/container.go
index 29300a6a4..969cb2dc8 100644
--- a/cmd/podman/container.go
+++ b/cmd/podman/container.go
@@ -1,30 +1,21 @@
package main
import (
- "sort"
-
- "github.com/urfave/cli"
+ "github.com/containers/libpod/cmd/podman/cliconfig"
+ "github.com/spf13/cobra"
)
-var (
- containerSubCommands = []cli.Command{
- exportCommand,
- inspectCommand,
- }
- containerDescription = "Manage containers"
- containerCommand = cli.Command{
- Name: "container",
- Usage: "Manage Containers",
- Description: containerDescription,
- ArgsUsage: "",
- Subcommands: getContainerSubCommandsSorted(),
- UseShortOptionHandling: true,
- OnUsageError: usageErrorHandler,
- }
-)
+var containerDescription = "Manage containers"
+var containerCommand = cliconfig.PodmanCommand{
+ Command: &cobra.Command{
+ Use: "container",
+ Short: "Manage Containers",
+ Long: containerDescription,
+ TraverseChildren: true,
+ },
+}
-func getContainerSubCommandsSorted() []cli.Command {
- containerSubCommands = append(containerSubCommands, getContainerSubCommands()...)
- sort.Sort(commandSortedAlpha{containerSubCommands})
- return containerSubCommands
+func init() {
+ containerCommand.AddCommand(getContainerSubCommands()...)
+ rootCmd.AddCommand(containerCommand.Command)
}