This brings back this message in case missing arguments.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
| ... | ... |
@@ -18,7 +18,8 @@ func NoArgs(cmd *cobra.Command, args []string) error {
|
| 18 | 18 |
} |
| 19 | 19 |
|
| 20 | 20 |
return fmt.Errorf( |
| 21 |
- "\"%s\" accepts no argument(s).\n\nUsage: %s\n\n%s", |
|
| 21 |
+ "\"%s\" accepts no argument(s).\nSee '%s --help'.\n\nUsage: %s\n\n%s", |
|
| 22 |
+ cmd.CommandPath(), |
|
| 22 | 23 |
cmd.CommandPath(), |
| 23 | 24 |
cmd.UseLine(), |
| 24 | 25 |
cmd.Short, |
| ... | ... |
@@ -32,9 +33,10 @@ func RequiresMinArgs(min int) cobra.PositionalArgs {
|
| 32 | 32 |
return nil |
| 33 | 33 |
} |
| 34 | 34 |
return fmt.Errorf( |
| 35 |
- "\"%s\" requires at least %d argument(s).\n\nUsage: %s\n\n%s", |
|
| 35 |
+ "\"%s\" requires at least %d argument(s).\nSee '%s --help'.\n\nUsage: %s\n\n%s", |
|
| 36 | 36 |
cmd.CommandPath(), |
| 37 | 37 |
min, |
| 38 |
+ cmd.CommandPath(), |
|
| 38 | 39 |
cmd.UseLine(), |
| 39 | 40 |
cmd.Short, |
| 40 | 41 |
) |
| ... | ... |
@@ -48,9 +50,10 @@ func ExactArgs(number int) cobra.PositionalArgs {
|
| 48 | 48 |
return nil |
| 49 | 49 |
} |
| 50 | 50 |
return fmt.Errorf( |
| 51 |
- "\"%s\" requires exactly %d argument(s).\n\nUsage: %s\n\n%s", |
|
| 51 |
+ "\"%s\" requires exactly %d argument(s).\nSee '%s --help'.\n\nUsage: %s\n\n%s", |
|
| 52 | 52 |
cmd.CommandPath(), |
| 53 | 53 |
number, |
| 54 |
+ cmd.CommandPath(), |
|
| 54 | 55 |
cmd.UseLine(), |
| 55 | 56 |
cmd.Short, |
| 56 | 57 |
) |