diff options
author | baude <bbaude@redhat.com> | 2019-01-31 13:20:04 -0600 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-02-08 10:26:43 -0600 |
commit | 25a3923b61a5ca014318e6d957f68abd03947297 (patch) | |
tree | 2ccb4a0bd9bda70c1c258dcb1b8aca8961d9ad30 /cmd/podman/system.go | |
parent | 962850c6e0dfcee926af31fc0ad24f1f6c26f8ac (diff) | |
download | podman-25a3923b61a5ca014318e6d957f68abd03947297.tar.gz podman-25a3923b61a5ca014318e6d957f68abd03947297.tar.bz2 podman-25a3923b61a5ca014318e6d957f68abd03947297.zip |
Migrate to cobra CLI
We intend to migrate to the cobra cli from urfave/cli because the
project is more well maintained. There are also some technical reasons
as well which extend into our remote client work.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/system.go')
-rw-r--r-- | cmd/podman/system.go | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/cmd/podman/system.go b/cmd/podman/system.go index 9596252ad..f6b28fee1 100644 --- a/cmd/podman/system.go +++ b/cmd/podman/system.go @@ -1,29 +1,23 @@ package main import ( - "sort" - - "github.com/urfave/cli" + "github.com/containers/libpod/cmd/podman/cliconfig" + "github.com/spf13/cobra" ) var ( - systemSubCommands = []cli.Command{ - pruneSystemCommand, - } systemDescription = "Manage podman" - systemCommand = cli.Command{ - Name: "system", - Usage: "Manage podman", - Description: systemDescription, - ArgsUsage: "", - Subcommands: getSystemSubCommandsSorted(), - UseShortOptionHandling: true, - OnUsageError: usageErrorHandler, + + systemCommand = cliconfig.PodmanCommand{ + Command: &cobra.Command{ + Use: "system", + Short: "Manage podman", + Long: systemDescription, + }, } ) -func getSystemSubCommandsSorted() []cli.Command { - systemSubCommands = append(systemSubCommands, getSystemSubCommands()...) - sort.Sort(commandSortedAlpha{systemSubCommands}) - return systemSubCommands +func init() { + systemCommand.AddCommand(getSystemSubCommands()...) + rootCmd.AddCommand(systemCommand.Command) } |