aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 41a95338b..77758b929 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2973,13 +2973,19 @@ int main(int arg_count, char const **arg_ptr) {
break;
}
}
- if(run_args_start_idx != -1) {
+ if (run_args_start_idx != -1) {
last_non_run_arg = run_args_start_idx;
+
+ if (run_args_start_idx == 2) {
+ // missing src path on argv[2], invocation: odin [run|test] --
+ usage(args[0]);
+ return 1;
+ }
+
for(isize i = run_args_start_idx+1; i < args.count; ++i) {
array_add(&run_args, args[i]);
}
}
-
args = array_slice(args, 0, last_non_run_arg);
run_args_string = string_join_and_quote(heap_allocator(), run_args);