diff options
Diffstat (limited to 'zup.c')
-rw-r--r-- | zup.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -234,10 +234,19 @@ main(int argc, char *argv[]) int fd = open_tty(param.port, param.baud); - if (ind == argc || param.repl) + if (ind == argc || param.repl) { repl(fd, ¶m); - else - suc = run_commands(fd, ¶m, argc - ind, &argv[ind]); + } else { + argc -= ind; + argv = &argv[ind]; + + int err = 0; + for (int i = 0; i < argc && !err; ++i) + err = run_line(fd, ¶m, argv[i], ":"); + + if (err) + suc = EXIT_FAILURE; + } close(fd); exit(EXIT_SUCCESS); |