diff options
Diffstat (limited to 'listbas.c')
-rw-r--r-- | listbas.c | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -12,7 +12,7 @@ #include "bcdfp.h" #include "tokens.h" -int immediate = 0, a8utf8 = 0, a8eol = 1; +int immediate = 0, a8cat = 1, magazine = 0; FILE *outfh; @@ -21,18 +21,19 @@ void print_help(void) { printf(" -v: verbose.\n"); printf(" -i: show immediate mode command (line 32768).\n"); printf(" -a: output raw ATASCII.\n"); - printf(" -u: output Unicode.\n"); + printf(" -m: magazine style listing (see a8cat(1)).\n"); } void parse_args(int argc, char **argv) { int opt; - while( (opt = getopt(argc, argv, "viau")) != -1) { + while( (opt = getopt(argc, argv, "viamh")) != -1) { switch(opt) { case 'v': verbose = 1; break; case 'i': immediate = 1; break; - case 'a': a8utf8 = a8eol = 0; break; - case 'u': a8utf8 = 1; a8eol = 0; break; + case 'a': a8cat = magazine = 0; break; + case 'm': a8cat = magazine = 1; break; + case 'h': print_help(); exit(0); default: print_help(); exit(1); @@ -50,10 +51,11 @@ void setup_outfh(void) { /* search current dir before PATH. no easy way to detect errors here, have to wait until we call pclose(). */ - if(a8eol) { - cmd = "./a8eol -u -c 2>/dev/null || a8eol -u -c 2>/dev/null || exit 1"; - } else if(a8utf8) { - cmd = "./a8utf8 2>/dev/null || a8utf8 2>/dev/null || exit 1"; + if(a8cat) { + if(magazine) + cmd = "./a8cat -m 2>/dev/null || a8cat -m 2>/dev/null || exit 1"; + else + cmd = "./a8cat 2>/dev/null || a8cat 2>/dev/null || exit 1"; } else { if(isatty(fileno(stdout))) { die("Refusing to write ATASCII data to the terminal."); @@ -72,9 +74,9 @@ void setup_outfh(void) { } void close_outfh(void) { - if(a8eol || a8utf8) { + if(a8cat) { if(pclose(outfh)) { - die("output filter failed; a8eol or a8utf8 not in current dir or $PATH."); + die("output filter failed; a8cat not in current dir or $PATH."); } } } |