We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4702584 commit 64d23c5Copy full SHA for 64d23c5
1 file changed
app.go
@@ -464,14 +464,18 @@ func (a *Application) validateRequired(context *ParseContext) error {
464
}
465
466
// Check required flags and set defaults.
467
+ var missingFlags []string
468
for _, flag := range context.flags.long {
469
if flagElements[flag.name] == nil {
470
// Check required flags were provided.
471
if flag.needsValue() {
- return fmt.Errorf("required flag --%s not provided", flag.name)
472
+ missingFlags = append(missingFlags, fmt.Sprintf("'--%s'", flag.name))
473
474
475
476
+ if len(missingFlags) != 0 {
477
+ return fmt.Errorf("required flag(s) %s not provided", strings.Join(missingFlags, ", "))
478
+ }
479
480
for _, arg := range context.arguments.args {
481
if argElements[arg.name] == nil {
0 commit comments