(t *testing.T)
| 305 | } |
| 306 | |
| 307 | func TestOptionInVeryBeginningOfLine(t *testing.T) { |
| 308 | fooHelp := ` |
| 309 | usage: foo <flags> |
| 310 | |
| 311 | -h show help |
| 312 | --foo foo option |
| 313 | ` |
| 314 | |
| 315 | desc, err := ParseHelp([]string{"foo", "-h"}, fooHelp) |
| 316 | require.Nil(t, err) |
| 317 | |
| 318 | expected := datastore.HelpPage{ |
| 319 | ExecutablePath: "foo", |
| 320 | Completions: []datastore.Completion{ |
| 321 | {Flag: "-h"}, |
| 322 | {Flag: "--foo"}, // it might be |
| 323 | }, |
| 324 | CheckSum: "da4c610510f4addb1089ae41896d09bfd0ccd790", |
| 325 | } |
| 326 | require.Equal(t, expected, *desc) |
| 327 | } |
nothing calls this directly
no test coverage detected