summaryrefslogtreecommitdiff
path: root/zup.c
diff options
context:
space:
mode:
Diffstat (limited to 'zup.c')
-rw-r--r--zup.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/zup.c b/zup.c
index 1647bb3..9dff1c0 100644
--- a/zup.c
+++ b/zup.c
@@ -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, &param);
- else
- suc = run_commands(fd, &param, 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, &param, argv[i], ":");
+
+ if (err)
+ suc = EXIT_FAILURE;
+ }
close(fd);
exit(EXIT_SUCCESS);