aboutsummaryrefslogtreecommitdiff
path: root/listbas.c
diff options
context:
space:
mode:
Diffstat (limited to 'listbas.c')
-rw-r--r--listbas.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/listbas.c b/listbas.c
index 11455e5..eed8334 100644
--- a/listbas.c
+++ b/listbas.c
@@ -77,6 +77,7 @@ int underline = 0; /* 1 with -u */
int skip_lineno = 0; /* 1 with -l */
int dump_tables = 0; /* 1 with -D */
int autodetect = 1; /* 0 with -b */
+int mixed_case = 1; /* 0 with -k, or if input is B_ATARI or B_APLUS */
/* change these with -c */
int color_cmd = C_YELLOW;
@@ -145,7 +146,7 @@ int get_bas_type(char *arg) {
}
void print_help(void) {
- printf("Usage: %s [-a|-d|-m|-x|-U] [-B] [-i] [-l] [-u] [-n|-C] [-v] [-c *colors*] <inputfile>\n", self);
+ printf("Usage: %s [-a|-d|-m|-x|-U] [-B] [-i] [-l] [-u] [-n|-C] [-v] [-c *colors*] [-k] <inputfile>\n", self);
printf(" -b <XX>: set BASIC type. XX is: a = atari, t = turbo, xl, xe, a+.\n");
printf(" -U: output ATASCII as Unicode/UTF-8 (this is the default).\n");
printf(" -a: output raw ATASCII.\n");
@@ -159,6 +160,7 @@ void print_help(void) {
printf(" -n: disable color syntax highlighting.\n");
printf(" -u: use underline for inverse video.\n");
printf(" -c: use custom colors (see man page).\n");
+ printf(" -k: disable mixed case keywords for BXL/BXE (e.g. Print).\n");
printf(" -v: verbose.\n");
}
@@ -167,7 +169,7 @@ void parse_args(int argc, char **argv, int from_env) {
optind = 1;
- while( (opt = getopt(argc, argv, "Db:UCviamnBdhxulc:")) != -1) {
+ while( (opt = getopt(argc, argv, "Db:UCviamnBdhxulc:k")) != -1) {
switch(opt) {
case 'U': output_mode = M_UTF8; break;
case 'a': output_mode = M_ATASCII; color = 0; break;
@@ -182,6 +184,7 @@ void parse_args(int argc, char **argv, int from_env) {
case 'C': color = 1; break;
case 'n': color = 0; break;
case 'l': skip_lineno = 1; break;
+ case 'k': mixed_case = 0; break;
case 'b': autodetect = 0; bas_type = get_bas_type(optarg); break;
case 'c': parse_color_scheme(optarg); break;
case 'h': print_help(); exit(0);
@@ -493,7 +496,7 @@ CALLBACK(print_cmd) {
if(bas_type == B_BXL && tok == 0x5a)
name = get_bxl_ext_name(program[pos + 1]);
- if(bas_type == B_BXL || bas_type == B_BXE) {
+ if(mixed_case && (bas_type == B_BXL || bas_type == B_BXE)) {
print_mixed_case(name);
outchr(' ');
} else {
@@ -839,6 +842,9 @@ void init_bas_dialect() {
if(bas_type == B_BXL)
bxl_exttok_hack = 1;
+
+ if(bas_type == B_ATARI || bas_type == B_APLUS || bas_type == B_TURBO)
+ mixed_case = 0;
}
int main(int argc, char **argv) {