v: show an error and exit, when no module name is given in `v build-module` (#10338)

pull/10347/head
zakuro 2021-06-05 00:30:43 +09:00 committed by GitHub
parent 117295e1f3
commit b0c9a87292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -634,6 +634,10 @@ pub fn parse_args(known_external_commands []string, args []string) (&Preferences
} }
if command == 'build-module' { if command == 'build-module' {
res.build_mode = .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] res.path = args[command_pos + 1]
} }
// keep only the unique res.build_options: // keep only the unique res.build_options: