Add jsonCmd test command variable
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
This commit is contained in:
parent
2b304a5e84
commit
b445adae20
1 changed files with 10 additions and 0 deletions
|
|
@ -26,6 +26,8 @@ func init() {
|
|||
printCmd.Flags().IntP("intthree", "i", 345, "help message for flag intthree")
|
||||
printCmd.Flags().BoolP("boolthree", "b", true, "help message for flag boolthree")
|
||||
|
||||
jsonCmd.Flags().StringSlice("json", nil, "help message for flag json")
|
||||
|
||||
echoCmd.AddCommand(timesCmd, echoSubCmd, deprecatedCmd)
|
||||
rootCmd.AddCommand(printCmd, echoCmd, dummyCmd)
|
||||
}
|
||||
|
|
@ -73,6 +75,14 @@ var printCmd = &cobra.Command{
|
|||
Long: `an absolutely utterly useless command for testing.`,
|
||||
}
|
||||
|
||||
var jsonCmd = &cobra.Command{
|
||||
Use: "blah --json <fields>",
|
||||
Short: "View details in JSON",
|
||||
Annotations: map[string]string{
|
||||
"help:json-fields": "foo,bar,baz",
|
||||
},
|
||||
}
|
||||
|
||||
var dummyCmd = &cobra.Command{
|
||||
Use: "dummy [action]",
|
||||
Short: "Performs a dummy action",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue