Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Feb 12, 2022
1 parent 86bdb18 commit b617223
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 0 deletions.
8 changes: 8 additions & 0 deletions completers/kustomize_completer/cmd/cfg_createSetter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@ func init() {
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(),
)
}
4 changes: 4 additions & 0 deletions completers/kustomize_completer/cmd/cfg_createSubst.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ func init() {
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(),
)
}
4 changes: 4 additions & 0 deletions completers/kustomize_completer/cmd/cfg_fmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ func init() {
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(),
)
}
5 changes: 5 additions & 0 deletions completers/kustomize_completer/cmd/cfg_grep.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ func init() {
cfg_grepCmd.Flags().Bool("invert-match", false, "Selected Resources are those not matching any of the specified patterns..")
cfg_grepCmd.Flags().BoolP("recurse-subpackages", "R", true, "also print resources recursively in all the nested subpackages")
cfgCmd.AddCommand(cfg_grepCmd)

carapace.Gen(cfg_grepCmd).PositionalCompletion(
carapace.ActionValues(),
carapace.ActionDirectories(),
)
}
4 changes: 4 additions & 0 deletions completers/kustomize_completer/cmd/cfg_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ var cfg_initCmd = &cobra.Command{
func init() {
carapace.Gen(cfg_initCmd).Standalone()
cfgCmd.AddCommand(cfg_initCmd)

carapace.Gen(cfg_initCmd).PositionalCompletion(
carapace.ActionDirectories(),
)
}
4 changes: 4 additions & 0 deletions completers/kustomize_completer/cmd/cfg_listSetters.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ func init() {
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(),
)
}
6 changes: 6 additions & 0 deletions completers/kustomize_completer/cmd/cfg_merge3.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@ func init() {
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(),
})
}
4 changes: 4 additions & 0 deletions completers/kustomize_completer/cmd/cfg_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ func init() {
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(),
)
}
8 changes: 8 additions & 0 deletions completers/kustomize_completer/cmd/cfg_tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@ func init() {
cfg_treeCmd.Flags().Bool("replicas", false, "print replicas field")
cfg_treeCmd.Flags().Bool("resources", false, "print resources field")
cfgCmd.AddCommand(cfg_treeCmd)

carapace.Gen(cfg_treeCmd).FlagCompletion(carapace.ActionMap{
"graph-structure": carapace.ActionValues("owners", "directory"),
})

carapace.Gen(cfg_treeCmd).PositionalCompletion(
carapace.ActionDirectories(),
)
}
4 changes: 4 additions & 0 deletions completers/kustomize_completer/cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ var completionCmd = &cobra.Command{
func init() {
carapace.Gen(completionCmd).Standalone()
rootCmd.AddCommand(completionCmd)

carapace.Gen(completionCmd).PositionalCompletion(
carapace.ActionValues("bash", "zsh", "fish", "powershell"),
)
}

0 comments on commit b617223

Please sign in to comment.