(t *testing.T)
| 155 | } |
| 156 | |
| 157 | func TestManPrintFlagsHidesShortDeprecated(t *testing.T) { |
| 158 | c := &cobra.Command{} |
| 159 | c.Flags().StringP("foo", "f", "default", "Foo flag") |
| 160 | _ = c.Flags().MarkShorthandDeprecated("foo", "don't use it no more") |
| 161 | |
| 162 | buf := new(bytes.Buffer) |
| 163 | manPrintFlags(buf, c.Flags()) |
| 164 | |
| 165 | got := buf.String() |
| 166 | expected := "`--foo` `<string> (default \"default\")`\n: Foo flag\n\n" |
| 167 | if got != expected { |
| 168 | t.Errorf("Expected %q, got %q", expected, got) |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | func TestGenManTree(t *testing.T) { |
| 173 | c := &cobra.Command{Use: "do [OPTIONS] arg1 arg2"} |
nothing calls this directly
no test coverage detected