From 1fb6710c89b7e81044a23fefc322e951df071fe7 Mon Sep 17 00:00:00 2001 From: zakuro Date: Thu, 31 Dec 2020 23:24:55 +0900 Subject: [PATCH] build: remove `v build file.v` (#7695) --- cmd/v/help/build.txt | 2 +- vlib/v/pref/pref.v | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/v/help/build.txt b/cmd/v/help/build.txt index 84ce0a9c50..e8dd9f0af2 100644 --- a/cmd/v/help/build.txt +++ b/cmd/v/help/build.txt @@ -1,4 +1,4 @@ -Usage: v [build flags] ['build'] +Usage: v [build flags] This command compiles the given target, along with their dependencies, into an executable. diff --git a/vlib/v/pref/pref.v b/vlib/v/pref/pref.v index 5b5d3f15e6..3466e7ba26 100644 --- a/vlib/v/pref/pref.v +++ b/vlib/v/pref/pref.v @@ -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