From b0c9a8729224430ed015b1b244e348e076ba4c86 Mon Sep 17 00:00:00 2001 From: zakuro Date: Sat, 5 Jun 2021 00:30:43 +0900 Subject: [PATCH] v: show an error and exit, when no module name is given in `v build-module` (#10338) --- vlib/v/pref/pref.v | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vlib/v/pref/pref.v b/vlib/v/pref/pref.v index 561fed58d0..19c0286e43 100644 --- a/vlib/v/pref/pref.v +++ b/vlib/v/pref/pref.v @@ -634,6 +634,10 @@ pub fn parse_args(known_external_commands []string, args []string) (&Preferences } if command == 'build-module' { res.build_mode = .build_module + if command_pos + 1 >= args.len { + eprintln('v build-module: no module specified') + exit(1) + } res.path = args[command_pos + 1] } // keep only the unique res.build_options: