From 25a3923b61a5ca014318e6d957f68abd03947297 Mon Sep 17 00:00:00 2001 From: baude Date: Thu, 31 Jan 2019 13:20:04 -0600 Subject: 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 --- cmd/podman/generate.go | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'cmd/podman/generate.go') diff --git a/cmd/podman/generate.go b/cmd/podman/generate.go index 20a4a61ab..a5e15fdd6 100644 --- a/cmd/podman/generate.go +++ b/cmd/podman/generate.go @@ -1,23 +1,21 @@ package main import ( - "github.com/urfave/cli" + "github.com/containers/libpod/cmd/podman/cliconfig" + "github.com/spf13/cobra" ) -var ( - generateSubCommands = []cli.Command{ - containerKubeCommand, - } +var generateDescription = "Generate structured data based for a containers and pods" +var generateCommand = cliconfig.PodmanCommand{ - generateDescription = "Generate structured data based for a containers and pods" - kubeCommand = cli.Command{ - Name: "generate", - Usage: "Generate structured data", - Description: generateDescription, - ArgsUsage: "", - Subcommands: generateSubCommands, - UseShortOptionHandling: true, - OnUsageError: usageErrorHandler, - Hidden: true, - } -) + Command: &cobra.Command{ + Use: "generate", + Short: "Generated structured data", + Long: generateDescription, + }, +} + +func init() { + generateCommand.AddCommand(getGenerateSubCommands()...) + rootCmd.AddCommand(generateCommand.Command) +} -- cgit v1.2.3-54-g00ecf