diff options
| author | Rob Landley <rob@landley.net> | 2015-04-07 11:54:36 -0500 |
|---|---|---|
| committer | Rob Landley <rob@landley.net> | 2015-04-07 11:54:36 -0500 |
| commit | e7acb4749dc655fee22d08f2723ea783f0d75fb6 (patch) | |
| tree | cb9a095adb4205c85d6164f5ca943c1f1e332289 | |
| parent | e0269f14c765abdc212f464d480fc3361fd7815b (diff) | |
| download | toybox-e7acb4749dc655fee22d08f2723ea783f0d75fb6.tar.gz | |
Adding --version broke ./toybox command list. (Oops.)
| -rw-r--r-- | main.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -157,12 +157,15 @@ void toybox_main(void) 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]) { |
