When min_argc == max_argc, the function checks whether exactly this
many arguments are given. In the error case, it says
exactly N non-option args allowed, M given
which reads a bit weird. With the patch applied the message becomes
exactly N non-option args required, M given
xasprintf(errctx, "no non-option args allowed, "
"%u given", lpr->num_inputs);
else
xasprintf(errctx, "no non-option args allowed, "
"%u given", lpr->num_inputs);
else
- xasprintf(errctx, "%s %u non-option args allowed, "
- "%u given", min_argc < max_argc?
- "at most" : "exactly",
- max_argc, lpr->num_inputs);
+ xasprintf(errctx, "%s %u non-option args %s, %u given",
+ min_argc < max_argc? "at most" : "exactly",
+ max_argc,
+ min_argc < max_argc? "allowed" : "required",
+ lpr->num_inputs);
return -E_LLS_BAD_ARG_COUNT;
}
return 1;
return -E_LLS_BAD_ARG_COUNT;
}
return 1;