diff options
author | Thomas Albers <thomas@thomaslabs.org> | 2023-08-06 16:04:59 +0200 |
---|---|---|
committer | Thomas Albers <thomas@thomaslabs.org> | 2023-08-06 16:04:59 +0200 |
commit | 30125839213e5b81e87c4fa3d7d3f4030b3659e3 (patch) | |
tree | 183670f0617059ac7b07927adcdcc9908f4c97aa /zup.c | |
parent | d0e2b015f25d53498da258d3ee988a101bc597fa (diff) |
Merge repl.c and cmd.c commands
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); |