summaryrefslogtreecommitdiff
path: root/cmd/podman/generate.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-02-08 20:12:38 +0100
committerGitHub <noreply@github.com>2019-02-08 20:12:38 +0100
commitafd4d5f4a4b05f421e6f336b4d74a0d808be57ed (patch)
tree2ccb4a0bd9bda70c1c258dcb1b8aca8961d9ad30 /cmd/podman/generate.go
parent962850c6e0dfcee926af31fc0ad24f1f6c26f8ac (diff)
parent25a3923b61a5ca014318e6d957f68abd03947297 (diff)
downloadpodman-afd4d5f4a4b05f421e6f336b4d74a0d808be57ed.tar.gz
podman-afd4d5f4a4b05f421e6f336b4d74a0d808be57ed.tar.bz2
podman-afd4d5f4a4b05f421e6f336b4d74a0d808be57ed.zip
Merge pull request #2274 from baude/cobraprep
Migrate to cobra CLI
Diffstat (limited to 'cmd/podman/generate.go')
-rw-r--r--cmd/podman/generate.go32
1 files changed, 15 insertions, 17 deletions
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)
+}