diff options
author | Leah Neukirchen <leah@vuxu.org> | 2023-10-13 23:03:02 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2023-10-13 23:03:02 +0200 |
commit | 65c4ebf3102f9970b18c3dd0445f1128f1f683f9 (patch) | |
tree | cdedcd1d16d2780002526c482c3f1427796e7c31 /mico-store.c | |
parent | 6660e95842fb64a98601d835362da992ab890db0 (diff) | |
download | mico-65c4ebf3102f9970b18c3dd0445f1128f1f683f9.tar.gz mico-65c4ebf3102f9970b18c3dd0445f1128f1f683f9.tar.xz mico-65c4ebf3102f9970b18c3dd0445f1128f1f683f9.zip |
use argv for filenames
Diffstat (limited to 'mico-store.c')
-rw-r--r-- | mico-store.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mico-store.c b/mico-store.c index 9cf4aaa..ade4788 100644 --- a/mico-store.c +++ b/mico-store.c @@ -105,7 +105,7 @@ put1(struct bitfile *bf, int64_t v) } int -main() +main(int argc, char *argv[]) { sh_new_arena(metrics); @@ -117,6 +117,11 @@ main() ssize_t linelen = 0; int i = 0; + if (argc < 2) { + fprintf(stderr, "usage: %s output.zip\n", argv[0]); + exit(-1); + } + while ((linelen = getdelim(&line, &linebuflen, '\n', stdin)) >= 0) { char *start = strchr(line, ' '); if (!start) break; @@ -159,7 +164,7 @@ main() arrlen(metrics[i].value)); } - zip_t *zip = zip_open("out.zip", ZIP_CREATE | ZIP_TRUNCATE, 0); + zip_t *zip = zip_open(argv[1], ZIP_CREATE | ZIP_TRUNCATE, 0); if (!zip) exit(-1); |