Adding --version broke ./toybox command list. (Oops.)
diff --git a/main.c b/main.c
index dbc39be..a800dee 100644
--- a/main.c
+++ b/main.c
@@ -157,12 +157,15 @@
if (toys.argv[1]) {
toys.optc = toys.recursion = 0;
toy_exec(toys.argv+1);
+ if (!strcmp("--version", toys.argv[1])) {
+ xputs(TOYBOX_VERSION);
+ xexit();
+ }
if (toys.argv[1][0] != '-') error_exit("Unknown command %s", toys.argv[1]);
}
- if (!strcmp("--version", toys.argv[1])) printf(TOYBOX_VERSION);
// Output list of command.
- else for (i=1; i<ARRAY_LEN(toy_list); i++) {
+ for (i=1; i<ARRAY_LEN(toy_list); i++) {
int fl = toy_list[i].flags;
if (fl & TOYMASK_LOCATION) {
if (toys.argv[1]) {