|
53 | 53 | // |
54 | 54 | // The following are some common ways of how options can be provided: |
55 | 55 | // |
56 | | -// --opt // long form boolean option |
57 | | -// --opt=v // long form non-boolean option with value of "v" |
58 | | -// --opt v // same as above, non-boolean options can provide their value as the next command line argument |
59 | | -// -a // short form boolean option "a" |
60 | | -// -a -b // two short form boolean option "a" and "b" |
61 | | -// -ab // either same as above, or short form non-boolean option "a" with value of "b" (depends on specified command structure) |
| 56 | +// --opt // long form boolean option "opt" |
| 57 | +// -o // short form boolean option "o" |
| 58 | +// --opt=val // long form non-boolean option with value of "val" |
| 59 | +// --opt val // same as above, non-boolean options can provide their value as the next command line argument |
| 60 | +// -a -b // two short form boolean options, "a" and "b" |
| 61 | +// -ab // either same as above, or short form non-boolean option "a" with value of "b" (depends on specified command structure) |
62 | 62 | // |
63 | 63 | // # Basic Usage |
64 | 64 | // |
65 | | -// p := cli.New(). |
| 65 | +// c := cli.New(). |
66 | 66 | // Help("A full example program"). |
67 | 67 | // Opt(cli.NewBoolOpt("yes"). |
68 | 68 | // Short('y'). |
@@ -536,9 +536,9 @@ func parse(c *CommandInfo, p *Command, args []string) error { |
536 | 536 | if len(missing) > 0 { |
537 | 537 | errMissingOpts = MissingOptionsError{Names: missing} |
538 | 538 |
|
539 | | - // If we are parsing positional arguments instead of subcommands, we can just |
540 | | - // return this error right now. Otherwise we have to wait to see if a subcommand |
541 | | - // requests help. |
| 539 | + // If we are about to parse positional arguments instead of subcommands, |
| 540 | + // we can just return this error right now. Otherwise we have to wait |
| 541 | + // to see if a subcommand requests help. |
542 | 542 | if len(c.Subcmds) == 0 { |
543 | 543 | return errMissingOpts |
544 | 544 | } |
|
0 commit comments