diff options
author | Ori Bernstein <ori@eigenstate.org> | 2012-08-19 12:35:21 -0400 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2012-08-19 12:35:21 -0400 |
commit | fa9b8ec335f027943f5757503b2c2ebb283cc502 (patch) | |
tree | 95a7203f8b8bd568e5ed194fa3297c3c99e8a752 /util | |
parent | 8fc0919576234ccc15a9f66e43a326fd15f9ca79 (diff) | |
download | mc-fa9b8ec335f027943f5757503b2c2ebb283cc502.tar.gz |
Add to the manpages.
Diffstat (limited to 'util')
-rw-r--r-- | util/muse.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/util/muse.c b/util/muse.c index 336f794..42ae747 100644 --- a/util/muse.c +++ b/util/muse.c @@ -47,7 +47,9 @@ static void dumpuse(char *path) static void genuse(char *path) { Stab *globls; + char *p; FILE *f; + char buf[1024]; globls = file->file.globls; tyinit(globls); @@ -55,9 +57,13 @@ static void genuse(char *path) yyparse(); infer(file); - if (!outfile) - die("need output file name right now. FIX THIS."); - f = fopen(outfile, "w"); + if (outfile) { + p = outfile; + } else { + swapsuffix(buf, sizeof buf, path, ".myr", ".use"); + p = buf; + } + f = fopen(p, "w"); writeuse(f, file); fclose(f); } @@ -109,6 +115,11 @@ int main(int argc, char **argv) } if (merge) { + if (!outfile) { + fprintf(stderr, "Output file needed when merging usefiles."); + exit(1); + } + file = mkfile("internal"); file->file.exports = mkstab(); file->file.globls = mkstab(); |