When args.c is just enforcing max/min argument count with no options, imply ?

so "command -123" isn't an unknown option error.
This commit is contained in:
Rob Landley 2022-04-04 11:44:30 -05:00
parent a682f18b33
commit 42ce6272f5
2 changed files with 3 additions and 2 deletions

View File

@ -77,6 +77,7 @@
// ? Allow unknown arguments (pass them through to command).
// & first arg has imaginary dash (ala tar/ps/ar) which sets FLAGS_NODASH
// 0 Include argv[0] in optargs
// note: ^ and ? implied when no options
//
// At the end: [groups] of previously seen options
// - Only one in group (switch off) [-abc] means -ab=-b, -ba=-a, -abc=-c
@ -254,7 +255,7 @@ static int parse_optflaglist(struct getoptflagstate *gof)
// Parse option string into a linked list of options with attributes.
if (!*options) gof->stopearly++;
if (!*options) gof->stopearly++, gof->noerror++;
while (*options) {
char *temp;

View File

@ -6,7 +6,7 @@
* Documentation/block/ioprio.txt in the linux source.
USE_IONICE(NEWTOY(ionice, "^tc#<0>3=2n#<0>7=5p#", TOYFLAG_USR|TOYFLAG_BIN))
USE_IORENICE(NEWTOY(iorenice, "?<1>3", TOYFLAG_USR|TOYFLAG_BIN))
USE_IORENICE(NEWTOY(iorenice, "<1>3", TOYFLAG_USR|TOYFLAG_BIN))
config IONICE
bool "ionice"