diff --git a/completers/kustomize_completer/cmd/cfg_annotate.go b/completers/kustomize_completer/cmd/cfg_annotate.go deleted file mode 100644 index c5d1829ae9..0000000000 --- a/completers/kustomize_completer/cmd/cfg_annotate.go +++ /dev/null @@ -1,27 +0,0 @@ -package cmd - -import ( - "github.com/rsteube/carapace" - "github.com/spf13/cobra" -) - -var cfg_annotateCmd = &cobra.Command{ - Use: "annotate", - Short: "[Alpha] Set an annotation on Resources.", - Run: func(cmd *cobra.Command, args []string) {}, -} - -func init() { - carapace.Gen(cfg_annotateCmd).Standalone() - cfg_annotateCmd.Flags().String("apiVersion", "", "Resource apiVersion to annotate") - cfg_annotateCmd.Flags().String("kind", "", "Resource kind to annotate") - cfg_annotateCmd.Flags().StringSlice("kv", []string{}, "annotation as KEY=VALUE") - cfg_annotateCmd.Flags().String("name", "", "Resource name to annotate") - cfg_annotateCmd.Flags().String("namespace", "", "Resource namespace to annotate") - cfg_annotateCmd.Flags().BoolP("recurse-subpackages", "R", false, "add annotations recursively in all the nested subpackages") - cfgCmd.AddCommand(cfg_annotateCmd) - - carapace.Gen(cfg_annotateCmd).PositionalCompletion( - carapace.ActionDirectories(), - ) -} diff --git a/completers/kustomize_completer/cmd/cfg_createSetter.go b/completers/kustomize_completer/cmd/cfg_createSetter.go deleted file mode 100644 index 1e59ebfd1b..0000000000 --- a/completers/kustomize_completer/cmd/cfg_createSetter.go +++ /dev/null @@ -1,33 +0,0 @@ -package cmd - -import ( - "github.com/rsteube/carapace" - "github.com/spf13/cobra" -) - -var cfg_createSetterCmd = &cobra.Command{ - Use: "create-setter", - Short: "[Alpha] Create a custom setter for a Resource field", - Run: func(cmd *cobra.Command, args []string) {}, -} - -func init() { - carapace.Gen(cfg_createSetterCmd).Standalone() - cfg_createSetterCmd.Flags().String("description", "", "record a description for the current setter value.") - cfg_createSetterCmd.Flags().String("field", "", "name of the field to set, a suffix of the path to the field, or the full path to the field. Default is to match all fields.") - cfg_createSetterCmd.Flags().BoolP("recurse-subpackages", "R", false, "creates setter recursively in all the nested subpackages") - cfg_createSetterCmd.Flags().Bool("required", false, "indicates that this setter must be set by package consumer before live apply/preview") - cfg_createSetterCmd.Flags().String("schema-path", "", "openAPI schema file path for setter constraints -- file content e.g. {\"type\": \"string\", \"maxLength\": 15, \"enum\": [\"allowedValue1\", \"allowedValue2\"]}") - cfg_createSetterCmd.Flags().String("set-by", "", "record who the field was default by.") - cfg_createSetterCmd.Flags().String("type", "", "OpenAPI field type for the setter -- e.g. integer,boolean,string.") - cfg_createSetterCmd.Flags().String("value", "", "optional flag, alternative to specifying the value as an argument. e.g. used to specify values that start with '-'") - cfgCmd.AddCommand(cfg_createSetterCmd) - - carapace.Gen(cfg_createSetterCmd).FlagCompletion(carapace.ActionMap{ - "type": carapace.ActionValues("string", "number", "integer", "boolean", "array", "object"), - }) - - carapace.Gen(cfg_createSetterCmd).PositionalCompletion( - carapace.ActionDirectories(), - ) -} diff --git a/completers/kustomize_completer/cmd/cfg_createSubst.go b/completers/kustomize_completer/cmd/cfg_createSubst.go deleted file mode 100644 index 8aaf0e0d29..0000000000 --- a/completers/kustomize_completer/cmd/cfg_createSubst.go +++ /dev/null @@ -1,25 +0,0 @@ -package cmd - -import ( - "github.com/rsteube/carapace" - "github.com/spf13/cobra" -) - -var cfg_createSubstCmd = &cobra.Command{ - Use: "create-subst", - Short: "", - Run: func(cmd *cobra.Command, args []string) {}, -} - -func init() { - carapace.Gen(cfg_createSubstCmd).Standalone() - cfg_createSubstCmd.Flags().String("field", "", "name of the field to set -- e.g. --field image") - cfg_createSubstCmd.Flags().String("field-value", "", "value of the field to create substitution for -- e.g. --field-value nginx:0.1.0") - cfg_createSubstCmd.Flags().String("pattern", "", "substitution pattern") - cfg_createSubstCmd.Flags().BoolP("recurse-subpackages", "R", false, "creates substitution recursively in all the nested subpackages") - cfgCmd.AddCommand(cfg_createSubstCmd) - - carapace.Gen(cfg_createSubstCmd).PositionalCompletion( - carapace.ActionDirectories(), - ) -} diff --git a/completers/kustomize_completer/cmd/cfg_fmt.go b/completers/kustomize_completer/cmd/cfg_fmt.go deleted file mode 100644 index c4e3f138ad..0000000000 --- a/completers/kustomize_completer/cmd/cfg_fmt.go +++ /dev/null @@ -1,27 +0,0 @@ -package cmd - -import ( - "github.com/rsteube/carapace" - "github.com/spf13/cobra" -) - -var cfg_fmtCmd = &cobra.Command{ - Use: "fmt", - Short: "[Alpha] Format yaml configuration files.", - Run: func(cmd *cobra.Command, args []string) {}, -} - -func init() { - carapace.Gen(cfg_fmtCmd).Standalone() - cfg_fmtCmd.Flags().Bool("keep-annotations", false, "if true, keep index and filename annotations set on Resources.") - cfg_fmtCmd.Flags().Bool("override", false, "if true, override existing filepath annotations.") - cfg_fmtCmd.Flags().String("pattern", "%n_%k.yaml", "pattern to use for generating filenames for resources -- may contain the following") - cfg_fmtCmd.Flags().BoolP("recurse-subpackages", "R", false, "formats resource files recursively in all the nested subpackages") - cfg_fmtCmd.Flags().Bool("set-filenames", false, "if true, set default filenames on Resources without them") - cfg_fmtCmd.Flags().Bool("use-schema", false, "if true, uses openapi resource schema to format resources.") - cfgCmd.AddCommand(cfg_fmtCmd) - - carapace.Gen(cfg_fmtCmd).PositionalCompletion( - carapace.ActionDirectories(), - ) -} diff --git a/completers/kustomize_completer/cmd/cfg_init.go b/completers/kustomize_completer/cmd/cfg_init.go deleted file mode 100644 index e3ead432e0..0000000000 --- a/completers/kustomize_completer/cmd/cfg_init.go +++ /dev/null @@ -1,21 +0,0 @@ -package cmd - -import ( - "github.com/rsteube/carapace" - "github.com/spf13/cobra" -) - -var cfg_initCmd = &cobra.Command{ - Use: "init", - Short: "[Alpha] Initialize a directory with a Krmfile.", - Run: func(cmd *cobra.Command, args []string) {}, -} - -func init() { - carapace.Gen(cfg_initCmd).Standalone() - cfgCmd.AddCommand(cfg_initCmd) - - carapace.Gen(cfg_initCmd).PositionalCompletion( - carapace.ActionDirectories(), - ) -} diff --git a/completers/kustomize_completer/cmd/cfg_listSetters.go b/completers/kustomize_completer/cmd/cfg_listSetters.go deleted file mode 100644 index 6363a98b37..0000000000 --- a/completers/kustomize_completer/cmd/cfg_listSetters.go +++ /dev/null @@ -1,24 +0,0 @@ -package cmd - -import ( - "github.com/rsteube/carapace" - "github.com/spf13/cobra" -) - -var cfg_listSettersCmd = &cobra.Command{ - Use: "list-setters", - Short: "[Alpha] List setters for Resources.", - Run: func(cmd *cobra.Command, args []string) {}, -} - -func init() { - carapace.Gen(cfg_listSettersCmd).Standalone() - cfg_listSettersCmd.Flags().Bool("include-subst", false, "include substitutions in the output") - cfg_listSettersCmd.Flags().Bool("markdown", false, "output as github markdown") - cfg_listSettersCmd.Flags().BoolP("recurse-subpackages", "R", false, "list setters recursively in all the nested subpackages") - cfgCmd.AddCommand(cfg_listSettersCmd) - - carapace.Gen(cfg_listSettersCmd).PositionalCompletion( - carapace.ActionDirectories(), - ) -} diff --git a/completers/kustomize_completer/cmd/cfg_merge.go b/completers/kustomize_completer/cmd/cfg_merge.go deleted file mode 100644 index 4010eedb2f..0000000000 --- a/completers/kustomize_completer/cmd/cfg_merge.go +++ /dev/null @@ -1,18 +0,0 @@ -package cmd - -import ( - "github.com/rsteube/carapace" - "github.com/spf13/cobra" -) - -var cfg_mergeCmd = &cobra.Command{ - Use: "merge", - Short: "[Alpha] Merge Resource configuration files", - Run: func(cmd *cobra.Command, args []string) {}, -} - -func init() { - carapace.Gen(cfg_mergeCmd).Standalone() - cfg_mergeCmd.Flags().Bool("invert-order", false, "if true, merge Resources in the reverse order") - cfgCmd.AddCommand(cfg_mergeCmd) -} diff --git a/completers/kustomize_completer/cmd/cfg_merge3.go b/completers/kustomize_completer/cmd/cfg_merge3.go deleted file mode 100644 index 67a5456114..0000000000 --- a/completers/kustomize_completer/cmd/cfg_merge3.go +++ /dev/null @@ -1,27 +0,0 @@ -package cmd - -import ( - "github.com/rsteube/carapace" - "github.com/spf13/cobra" -) - -var cfg_merge3Cmd = &cobra.Command{ - Use: "merge3", - Short: "[Alpha] Merge diff of Resource configuration files into a destination (3-way)", - Run: func(cmd *cobra.Command, args []string) {}, -} - -func init() { - carapace.Gen(cfg_merge3Cmd).Standalone() - cfg_merge3Cmd.Flags().String("ancestor", "", "Path to original package") - cfg_merge3Cmd.Flags().String("from", "", "Path to updated package") - cfg_merge3Cmd.Flags().Bool("path-merge-key", false, "Use the path as part of the merge key when merging resources") - cfg_merge3Cmd.Flags().String("to", "", "Path to destination package") - cfgCmd.AddCommand(cfg_merge3Cmd) - - carapace.Gen(cfg_merge3Cmd).FlagCompletion(carapace.ActionMap{ - "ancestor": carapace.ActionDirectories(), - "from": carapace.ActionDirectories(), - "to": carapace.ActionDirectories(), - }) -} diff --git a/completers/kustomize_completer/cmd/cfg_set.go b/completers/kustomize_completer/cmd/cfg_set.go deleted file mode 100644 index b4025c41f9..0000000000 --- a/completers/kustomize_completer/cmd/cfg_set.go +++ /dev/null @@ -1,26 +0,0 @@ -package cmd - -import ( - "github.com/rsteube/carapace" - "github.com/spf13/cobra" -) - -var cfg_setCmd = &cobra.Command{ - Use: "set", - Short: "[Alpha] Set values on Resources fields values.", - Run: func(cmd *cobra.Command, args []string) {}, -} - -func init() { - carapace.Gen(cfg_setCmd).Standalone() - cfg_setCmd.Flags().String("description", "", "annotate the field with a description of its value") - cfg_setCmd.Flags().BoolP("recurse-subpackages", "R", false, "sets recursively in all the nested subpackages") - cfg_setCmd.Flags().String("set-by", "", "annotate the field with who set it") - cfg_setCmd.Flags().StringArray("values", []string{}, "optional flag, the values of the setter to be set to") - cfg_setCmd.Flags().String("version", "", "use this version of the setter format") - cfgCmd.AddCommand(cfg_setCmd) - - carapace.Gen(cfg_setCmd).PositionalCompletion( - carapace.ActionDirectories(), - ) -} diff --git a/pkg/carascrape/scrape.go b/pkg/carascrape/scrape.go index f242179192..4701bea7ec 100644 --- a/pkg/carascrape/scrape.go +++ b/pkg/carascrape/scrape.go @@ -83,7 +83,7 @@ var %vCmd = &cobra.Command{ ioutil.WriteFile(filename, out.Bytes(), 0644) for _, subcmd := range cmd.Commands() { - if !subcmd.Hidden { + if !subcmd.Hidden && subcmd.Deprecated == "" { Scrape(subcmd) } }