diff options
Diffstat (limited to 'listbas.c')
-rw-r--r-- | listbas.c | 34 |
1 files changed, 19 insertions, 15 deletions
@@ -52,10 +52,11 @@ int output_mode = M_UTF8; -int bold = 0; /* 1 with -b */ -int color = 1; /* 0 with -n */ -int immediate = 0; /* 1 with -i */ -int underline = 0; /* 1 with -u */ +int bold = 0; /* 1 with -b */ +int color = 1; /* 0 with -n */ +int immediate = 0; /* 1 with -i */ +int underline = 0; /* 1 with -u */ +int skip_lineno = 0; /* 1 with -l */ int color_cmd = C_YELLOW; int color_op = C_GREEN; @@ -66,9 +67,9 @@ int color_rem = C_BLUE; int color_data = C_CYAN; int color_varnames = NO_COLOR; -int badtok = 0; /* set to 1 if we find a bad token */ -int inv = 0; /* set to 1 when we're printing inverse */ -int cur_color = -1; /* -1 = no color */ +int badtok = 0; /* set to 1 if we find a bad token */ +int inv = 0; /* set to 1 when we're printing inverse */ +int cur_color = -1; /* -1 = no color */ FILE *outfh; int parse_color(char c) { @@ -99,7 +100,7 @@ void parse_color_scheme(const char *arg) { } void print_help(void) { - printf("Usage: %s [-a | -d | -m | -x] [-b] [-i] [-n] [-v] [-c *colors*] <inputfile>\n", self); + printf("Usage: %s [-a|-d|-m|-x|-U] [-b] [-i] [-l] [-u] [-n|-C] [-v] [-c *colors*] <inputfile>\n", self); printf(" -U: output ATASCII as Unicode/UTF-8 (this is the default).\n"); printf(" -a: output raw ATASCII.\n"); printf(" -d: use dots instead of Unicode/UTF-8.\n"); @@ -107,6 +108,7 @@ void print_help(void) { printf(" -x: XL international character set (UTF-8).\n"); printf(" -b: use bold for color output.\n"); printf(" -i: show immediate mode command (line 32768).\n"); + printf(" -l: don't print line numbers.\n"); printf(" -C: enable color syntax highlighting (this is the default).\n"); printf(" -n: disable color syntax highlighting.\n"); printf(" -u: use underline for inverse video.\n"); @@ -119,19 +121,20 @@ void parse_args(int argc, char **argv, int from_env) { optind = 1; - while( (opt = getopt(argc, argv, "UCviamnbdhxuc:")) != -1) { + while( (opt = getopt(argc, argv, "UCviamnbdhxulc:")) != -1) { switch(opt) { case 'U': output_mode = M_UTF8; break; case 'a': output_mode = M_ATASCII; break; case 'm': output_mode = M_MAG; break; case 'd': output_mode = M_DOTS; break; case 'x': output_mode = M_UTF8_I; break; - case 'v': verbose = 1; break; - case 'i': immediate = 1; break; - case 'b': bold = 1; break; - case 'u': underline = 1; break; - case 'C': color = 1; break; - case 'n': color = 0; break; + case 'v': verbose = 1; break; + case 'i': immediate = 1; break; + case 'b': bold = 1; break; + case 'u': underline = 1; break; + case 'C': color = 1; break; + case 'n': color = 0; break; + case 'l': skip_lineno = 1; break; case 'c': parse_color_scheme(optarg); break; case 'h': print_help(); exit(0); default: @@ -374,6 +377,7 @@ void print_string(unsigned int pos, unsigned int len) { } CALLBACK(print_lineno) { + if(skip_lineno) return; if(color) color_on(color_lineno); fprintf(outfh, "%d ", lineno); if(color) color_off(); |