// !X die with error if X already set (x!x die if x supplied twice)
// [yz] needs at least one of y or z.
// at the beginning:
-// + stop at first nonoption argument
+// ^ stop at first nonoption argument
// <0 at least # leftover arguments needed (default 0)
// >9 at most # leftover arguments needed (default MAX_INT)
// ? don't show_usage() on unknown argument.
// Parse leading special behavior indicators
for (;;) {
- if (*options == '+') stopearly++;
+ if (*options == '^') stopearly++;
else if (*options == '<') minargs=*(++options)-'0';
else if (*options == '>') maxargs=*(++options)-'0';
else if (*options == '?') gof.noerror++;
options++;
}
+ if (!*options) stopearly++;
// Parse rest of opts into array
while (*options) {
char *temp;
*
* See http://www.opengroup.org/onlinepubs/009695399/utilities/echo.html
-USE_ECHO(NEWTOY(echo, "+?en", TOYFLAG_BIN))
+USE_ECHO(NEWTOY(echo, "^?en", TOYFLAG_BIN))
config ECHO
bool "echo"
*
* Not in SUSv3.
-USE_ONEIT(NEWTOY(oneit, "+<1c:p", TOYFLAG_SBIN))
+USE_ONEIT(NEWTOY(oneit, "^<1c:p", TOYFLAG_SBIN))
config ONEIT
bool "oneit"
*
* Not in SUSv3. (Don't ask me why not.)
-USE_SEQ(NEWTOY(seq, "<1>3?+", TOYFLAG_USR|TOYFLAG_BIN))
+USE_SEQ(NEWTOY(seq, "<1>3?", TOYFLAG_USR|TOYFLAG_BIN))
config SEQ
bool "seq"