From 95574e3f2a47291651f7c78c873318344565e80e Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 18 Mar 2019 20:37:53 -0700 Subject: cmp/env/nice/nohup/sort: use TOYFLAG_ARGFAIL. Also be a bit more consistent about `COMMAND [ARG...]` in usage text. --- toys/posix/sort.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'toys/posix/sort.c') diff --git a/toys/posix/sort.c b/toys/posix/sort.c index 9bf81ebc..9d2f2276 100644 --- a/toys/posix/sort.c +++ b/toys/posix/sort.c @@ -7,7 +7,7 @@ * Deviations from POSIX: Lots. * We invented -x -USE_SORT(NEWTOY(sort, USE_SORT_FLOAT("g")"S:T:m" "o:k*t:" "xVbMcszdfirun", TOYFLAG_USR|TOYFLAG_BIN)) +USE_SORT(NEWTOY(sort, USE_SORT_FLOAT("g")"S:T:m" "o:k*t:" "xVbMcszdfirun", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(2))) config SORT bool "sort" @@ -345,6 +345,7 @@ void sort_main(void) if (!temp2 || flag>FLAG_x || (flag&(FLAG_u|FLAG_c|FLAG_s|FLAG_z))) { + toys.exitval = 2; error_exit("Unknown key option."); } // b after , means strip _trailing_ space, not leading. -- cgit v1.2.3