You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the `--viper` flag to automatically setup [viper](https://github.com/spf13/viper)
@@ -72,8 +72,8 @@ Viper is a companion to Cobra intended to provide easy handling of environment v
72
72
73
73
### Add commands to a project
74
74
75
-
Once a cobra application is initialized you can continue to use the Cobra generator to
76
-
add additional commands to your application. The command to do this is `cobra add`.
75
+
Once a cobra application is initialized you can continue to use the Cobra generator to
76
+
add additional commands to your application. The command to do this is `cobra add`.
77
77
78
78
Let's say you created an app and you wanted the following commands for it:
79
79
@@ -93,9 +93,9 @@ cobra add create -p 'configCmd'
93
93
94
94
You'll notice that this final command has a `-p` flag. This is used to assign a
95
95
parent command to the newly added command. In this case, we want to assign the
96
-
"create" command to the "config" command. All commands have a default parent of rootCmd if not specified.
96
+
"create" command to the "config" command. All commands have a default parent of rootCmd if not specified.
97
97
98
-
By default `cobra` will append `Cmd` to the name provided and uses this name for the internal variable name. When specifying a parent, be sure to match the variable name used in the code.
98
+
By default `cobra` will append `Cmd` to the name provided and uses this name for the internal variable name. When specifying a parent, be sure to match the variable name used in the code.
99
99
100
100
*Note: Use camelCase (not snake_case/kebab-case) for command names.
0 commit comments