Skip to content

Commit

Permalink
Add some more --for aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
jgustie committed Aug 18, 2022
1 parent 505b292 commit a1aedb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pkg/command/applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ func NewGetApplicationsCommand(cfg Config, p Printer) *cobra.Command {
cmd.Flags().StringVar(&product, "for", product, "show only clusters for a specific `product`; one of: optimize-pro|optimize-live")
cmd.Flags().IntVar(&batchSize, "batch-size", batchSize, "fetch large lists in chu`n`ks rather then all at once")

_ = cmd.RegisterFlagCompletionFunc("for", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{"optimize-pro", "optimize-live"}, cobra.ShellCompDirectiveDefault
})

cmd.RunE = func(cmd *cobra.Command, args []string) error {
ctx, out := cmd.Context(), cmd.OutOrStdout()
client, err := api.NewClient(cfg.Address(), nil)
Expand Down Expand Up @@ -347,7 +351,7 @@ func NewGetApplicationsCommand(cfg Config, p Printer) *cobra.Command {
// Only skip applications if we know it is one or the other
if isPro || isLive {
switch product {
case "optimize-pro", "pro":
case "optimize-pro", "pro", "optimize-controller", "controller":
if !isPro {
continue
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/command/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func NewGetClustersCommand(cfg Config, p Printer) *cobra.Command {
} else {
q := applications.ClusterListQuery{}
switch product {
case "optimize-pro", "pro":
case "optimize-pro", "pro", "optimize-controller", "controller":
q.SetModules(applications.ClusterScenarios)
case "optimize-live", "live":
q.SetModules(applications.ClusterRecommendations)
Expand Down

0 comments on commit a1aedb8

Please sign in to comment.