Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Commit 98ef534

Browse files
Adding bash completion for codegen and for the server
Signed-off-by: Christopher Hein <[email protected]>
1 parent e6a6bc9 commit 98ef534

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package main
2+
3+
import (
4+
"os"
5+
6+
"github.com/spf13/cobra"
7+
)
8+
9+
var completionCmd = &cobra.Command{
10+
Use: "completion",
11+
Short: "Generates the bash completion scripts",
12+
Long: `To load completion run
13+
. <(aws-service-operator completion)`,
14+
Run: func(cmd *cobra.Command, args []string) {
15+
rootCmd.GenBashCompletion(os.Stdout)
16+
},
17+
}
18+
19+
func init() {
20+
rootCmd.AddCommand(completionCmd)
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package main
2+
3+
import (
4+
"os"
5+
6+
"github.com/spf13/cobra"
7+
)
8+
9+
var completionCmd = &cobra.Command{
10+
Use: "completion",
11+
Short: "Generates the bash completion scripts",
12+
Long: `To load completion run
13+
. <(aws-service-operator-codegen completion)`,
14+
Run: func(cmd *cobra.Command, args []string) {
15+
rootCmd.GenBashCompletion(os.Stdout)
16+
},
17+
}
18+
19+
func init() {
20+
rootCmd.AddCommand(completionCmd)
21+
}

0 commit comments

Comments
 (0)