summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthew@masot.net>2023-07-30 18:09:52 -0700
committerMatthew Sotoudeh <matthew@masot.net>2023-07-30 18:09:52 -0700
commitf2297c20b69d942fd1e8fdcdd8f4d142c71de662 (patch)
tree5072f8f11eea2d8265e48d6c3bce533e124f016f /main.c
parentc84bbdc2a296f4b818fa8ec05a6dbe2dd46fc4f1 (diff)
bad line numbers support
Diffstat (limited to 'main.c')
-rw-r--r--main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/main.c b/main.c
index db9f31c..36c16e9 100644
--- a/main.c
+++ b/main.c
@@ -9,6 +9,7 @@ char *base_file;
StringArray include_paths;
bool opt_fcommon = false;
bool opt_fpic;
+bool opt_line_numbers;
static FILE *open_file(char *path) {
if (!path || strcmp(path, "-") == 0)
@@ -64,8 +65,14 @@ static void cc1(char *base_file) {
}
int main(int argc, char **argv) {
- assert(argc == 2);
- base_file = argv[1];
- cc1(argv[1]);
+ for (int i = 1; i < argc; i++) {
+ if (!strcmp(argv[i], "--line-numbers")) {
+ opt_line_numbers = 1;
+ } else {
+ assert(!base_file);
+ base_file = argv[1];
+ }
+ }
+ cc1(base_file);
return 0;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback