From b445adae20c66dd6dddf90c4fa768a0a14f4597b Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Mon, 6 May 2024 17:57:12 +0100 Subject: [PATCH] Add `jsonCmd` test command variable Signed-off-by: Babak K. Shandiz --- internal/docs/docs_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/docs/docs_test.go b/internal/docs/docs_test.go index ad1b32631..06e924224 100644 --- a/internal/docs/docs_test.go +++ b/internal/docs/docs_test.go @@ -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 ", + 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",