From 351a3e8ffcaee91f5e825d01ca09bbf5d7eeb288 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Thu, 13 Jul 2023 15:27:38 +0200 Subject: [PATCH] chore(cli): create 'file' subcommand for ApiOps commands --- cmd/file.go | 24 ++++++++++++++++++++++++ cmd/root.go | 18 +++++++++++------- 2 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 cmd/file.go diff --git a/cmd/file.go b/cmd/file.go new file mode 100644 index 000000000..50232e68c --- /dev/null +++ b/cmd/file.go @@ -0,0 +1,24 @@ +/* +Copyright © 2023 NAME HERE +*/ +package cmd + +import ( + "github.com/spf13/cobra" +) + +// +// +// Define the CLI data for the file sub-command +// +// + +func newAddFileCmd() *cobra.Command { + addFileCmd := &cobra.Command{ + Use: "file [sub-command]...", + Short: "Sub-command to host the decK file manipulation operations", + Long: `Sub-command to host the decK file manipulation operations`, + } + + return addFileCmd +} diff --git a/cmd/root.go b/cmd/root.go index bd7168cd1..2e19fd2da 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -215,13 +215,17 @@ It can be used to export, import, or sync entities to Kong.`, rootCmd.AddCommand(newCompletionCmd()) rootCmd.AddCommand(newKonnectCmd()) // commands from go-apiops library: - rootCmd.AddCommand(newAddPluginsCmd()) - rootCmd.AddCommand(newAddTagsCmd()) - rootCmd.AddCommand(newListTagsCmd()) - rootCmd.AddCommand(newRemoveTagsCmd()) - rootCmd.AddCommand(newMergeCmd()) - rootCmd.AddCommand(newPatchCmd()) - rootCmd.AddCommand(newOpenapi2KongCmd()) + fileCmd := newAddFileCmd() + { + rootCmd.AddCommand(fileCmd) + fileCmd.AddCommand(newAddPluginsCmd()) + fileCmd.AddCommand(newAddTagsCmd()) + fileCmd.AddCommand(newListTagsCmd()) + fileCmd.AddCommand(newRemoveTagsCmd()) + fileCmd.AddCommand(newMergeCmd()) + fileCmd.AddCommand(newPatchCmd()) + fileCmd.AddCommand(newOpenapi2KongCmd()) + } return rootCmd }