build: remove `v build file.v` (#7695)

pull/7759/head
zakuro 2020-12-31 23:24:55 +09:00 committed by GitHub
parent f7b3ed2f4a
commit 1fb6710c89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,4 @@
Usage: v [build flags] ['build'] <file.v|directory>
Usage: v [build flags] <file.v|directory>
This command compiles the given target, along with their dependencies, into an executable.

View File

@ -384,6 +384,10 @@ pub fn parse_args(args []string) (&Preferences, string) {
i++
}
else {
if command == 'build' && (arg.ends_with('.v') || os.exists(command)) {
eprintln('Use `v $arg` instead.')
exit(1)
}
if arg[0] == `-` {
if arg[1..] in list_of_flags_with_param {
// skip parameter