Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional command completion for federation #116

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/cmd/completions.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,16 @@ func completionDistributedService(_ *cobra.Command, _ []string, _ string) ([]str
return escapeValues(servicesResult, cobra.ShellCompDirectiveNoFileComp)
}

// completionFederatedService provides a completion function to return all federated services in a cluster.
// completionElasticData provides a completion function to return elastic data options.
func completionElasticData(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
return []string{ram, flash}, cobra.ShellCompDirectiveNoFileComp
}

// completionFederationOptions provides a completion function to return the options for get federation.
func completionFederationOptions(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
return []string{all, destinations, origins}, cobra.ShellCompDirectiveNoFileComp
}

// completionFederatedService provides a completion function to return all federated services in a cluster.
func completionFederatedService(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
_, dataFetcher, err := GetConnectionAndDataFetcher()
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/federation.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ can also specify '-o wide' to display addition information.`,
}
return nil
},
ValidArgsFunction: completionFederationOptions,
RunE: func(cmd *cobra.Command, args []string) error {
var (
err error
Expand Down