Skip to content

Commit b7b679b

Browse files
committed
Completion mysql-user
Signed-off-by: d-kuro <[email protected]>
1 parent 0b6f626 commit b7b679b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/kubectl-moco/cmd/credential.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ func init() {
5050
fs.StringVarP(&credentialConfig.user, "mysql-user", "u", "moco-readonly", "User for login to mysql")
5151
fs.StringVar(&credentialConfig.format, "format", "plain", "The format of output [`plain` or `mycnf`]")
5252

53+
_ = credentialCmd.RegisterFlagCompletionFunc("mysql-user", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
54+
return []string{"moco-readonly", "moco-writable", "moco-admin"}, cobra.ShellCompDirectiveDefault
55+
})
5356
_ = credentialCmd.RegisterFlagCompletionFunc("format", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
5457
return []string{"plain", "mycnf"}, cobra.ShellCompDirectiveDefault
5558
})

0 commit comments

Comments
 (0)