From 98ef53472f7e84660c54b9750d05f243f2677726 Mon Sep 17 00:00:00 2001 From: Christopher Hein Date: Wed, 28 Nov 2018 18:54:21 +0000 Subject: [PATCH] Adding bash completion for codegen and for the server Signed-off-by: Christopher Hein --- cmd/aws-service-operator/completion.go | 21 +++++++++++++++++++ .../completion.go | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 cmd/aws-service-operator/completion.go create mode 100644 code-generation/cmd/aws-service-operator-codegen/completion.go diff --git a/cmd/aws-service-operator/completion.go b/cmd/aws-service-operator/completion.go new file mode 100644 index 000000000..46b5e7f80 --- /dev/null +++ b/cmd/aws-service-operator/completion.go @@ -0,0 +1,21 @@ +package main + +import ( + "os" + + "github.com/spf13/cobra" +) + +var completionCmd = &cobra.Command{ + Use: "completion", + Short: "Generates the bash completion scripts", + Long: `To load completion run + . <(aws-service-operator completion)`, + Run: func(cmd *cobra.Command, args []string) { + rootCmd.GenBashCompletion(os.Stdout) + }, +} + +func init() { + rootCmd.AddCommand(completionCmd) +} diff --git a/code-generation/cmd/aws-service-operator-codegen/completion.go b/code-generation/cmd/aws-service-operator-codegen/completion.go new file mode 100644 index 000000000..a2a604a36 --- /dev/null +++ b/code-generation/cmd/aws-service-operator-codegen/completion.go @@ -0,0 +1,21 @@ +package main + +import ( + "os" + + "github.com/spf13/cobra" +) + +var completionCmd = &cobra.Command{ + Use: "completion", + Short: "Generates the bash completion scripts", + Long: `To load completion run + . <(aws-service-operator-codegen completion)`, + Run: func(cmd *cobra.Command, args []string) { + rootCmd.GenBashCompletion(os.Stdout) + }, +} + +func init() { + rootCmd.AddCommand(completionCmd) +}