diff options
author | Rob Landley <rob@landley.net> | 2022-04-04 11:44:30 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2022-04-04 11:44:30 -0500 |
commit | 42ce6272f5a3824bc3512c1888384e3914a386b5 (patch) | |
tree | 8cc1bb8dd0a42bb87e0ad8ebfbc7b9b88aac1634 | |
parent | a682f18b338d1eda088744d9b103689ff674f580 (diff) | |
download | toybox-42ce6272f5a3824bc3512c1888384e3914a386b5.tar.gz |
When args.c is just enforcing max/min argument count with no options, imply ?
so "command -123" isn't an unknown option error.
-rw-r--r-- | lib/args.c | 3 | ||||
-rw-r--r-- | toys/other/ionice.c | 2 |
2 files changed, 3 insertions, 2 deletions
@@ -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; diff --git a/toys/other/ionice.c b/toys/other/ionice.c index 07a212b2..db3a6f41 100644 --- a/toys/other/ionice.c +++ b/toys/other/ionice.c @@ -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" |