--- soelim.cc.orig Sat Mar 22 15:03:32 2003 +++ soelim.cc Sat Mar 22 15:15:00 2003 @@ -33,6 +33,8 @@ static char **include_list; int compatible_flag = 0; +int raw_flag = 0; +int tex_flag = 0; extern int interpret_lf_args(const char *); extern "C" const char *Version_string; @@ -60,7 +62,7 @@ void usage(FILE *stream) { - fprintf(stream, "usage: %s [ -vC ] [ -I file ] [ files ]\n", program_name); + fprintf(stream, "usage: %s [ -Crtv ] [ -I file ] [ files ]\n", program_name); } int main(int argc, char **argv) @@ -70,10 +72,12 @@ int opt; static const struct option long_options[] = { { "help", no_argument, 0, CHAR_MAX + 1 }, + { "raw", no_argument, 0, 'r' }, + { "tex", no_argument, 0, 't' }, { "version", no_argument, 0, 'v' }, { NULL, 0, 0, 0 } }; - while ((opt = getopt_long(argc, argv, "CI:v", long_options, NULL)) != EOF) + while ((opt = getopt_long(argc, argv, "CrtI:v", long_options, NULL)) != EOF) switch (opt) { case 'v': { @@ -87,6 +91,12 @@ case 'I': include_path_append(optarg); break; + case 'r': + raw_flag = 1; + break; + case 't': + tex_flag = 1; + break; case CHAR_MAX + 1: // --help usage(stdout); exit(0); @@ -111,7 +121,12 @@ void set_location() { - printf(".lf %d %s\n", current_lineno, current_filename); + if(!raw_flag) { + if(!tex_flag) + printf(".lf %d %s\n", current_lineno, current_filename); + else + printf("%% .lf %d %s\n", current_lineno, current_filename); + } } void do_so(const char *line)