ValidArgsGetCategory returns autocomplete suggestions for selecting a category. Since a category identified by a composite key of catalog and category name, first a list of catalogs is returned, then a category to select.
(_ *cobra.Command, args []string, toComplete string)
| 265 | // category. Since a category identified by a composite key of catalog and |
| 266 | // category name, first a list of catalogs is returned, then a category to select. |
| 267 | func ValidArgsGetCategory(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 268 | if len(args) == 0 { |
| 269 | return getCatalogs(toComplete), cobra.ShellCompDirectiveNoFileComp |
| 270 | } else if len(args) == 1 { |
| 271 | return getCategories(args[0], toComplete), cobra.ShellCompDirectiveNoFileComp |
| 272 | } else { |
| 273 | return []string{}, cobra.ShellCompDirectiveNoFileComp |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | // ValidArgsGetControls returns autocomplete suggestions for selecting a control. |
| 278 | // Since a control identified by a composite key of catalog, category and |