diff options
author | Rob Landley <rob@landley.net> | 2015-08-06 07:37:23 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-08-06 07:37:23 -0500 |
commit | 68986475982403b0dbc7c798d0a6e61c1a7be914 (patch) | |
tree | cf944e6369b8d91010f1b7c1c36b53fd7e8a06e3 | |
parent | 42b7d4b06b55e0090c3be1bc6ca1ed166bd6b2fd (diff) | |
download | toybox-68986475982403b0dbc7c798d0a6e61c1a7be914.tar.gz toybox-68986475982403b0dbc7c798d0a6e61c1a7be914.tar.bz2 toybox-68986475982403b0dbc7c798d0a6e61c1a7be914.zip |
Make multiplexer's "command not found" exit 127.
Somebody (carsonh on freenode) objected that they were running something
like "toybox test 1 == 2" and couldn't distinguish the test failing from
toybox not having the test command. Why they were running toybox out of
the multiplexer instead of having a test symlink in the $PATH, I couldn't
tell you. (Is "I know toybox is on this system, but don't know how it was
configured" a problem people actually have?)
*shrug* They care about it more than I do, so now you can't distinguish between
the multiplexer not being found and the command the multiplexer tried to
run not being found. Progress!
-rw-r--r-- | main.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -163,7 +163,10 @@ void toybox_main(void) xputs(TOYBOX_VERSION); xexit(); } - if (toys.argv[1][0] != '-') error_exit("Unknown command %s", toys.argv[1]); + if (toys.argv[1][0] != '-') { + toys.exitval = 127; + error_exit("Unknown command %s", toys.argv[1]); + } } // Output list of command. |