Skip to content

Commit

Permalink
Adapt variable names to Cobra example style
Browse files Browse the repository at this point in the history
  • Loading branch information
nirs committed Nov 12, 2023
1 parent 94e373a commit 720732d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@ import (
)

func main() {
root := &cobra.Command{
rootCmd := &cobra.Command{
Use: "kubectl-cobraplugin",
Annotations: map[string]string{
cobra.CommandDisplayNameAnnotation: "kubectl cobraplugin",
},
}

sub := &cobra.Command{
subCmd := &cobra.Command{
Use: "subcmd",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("kubectl cobraplugin subcmd")
},
}

root.AddCommand(sub)
root.Execute()
rootCmd.AddCommand(subCmd)
rootCmd.Execute()
}

0 comments on commit 720732d

Please sign in to comment.