1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cmd/v: process version argument correctly

This commit is contained in:
Alexey 2020-04-14 19:06:59 +03:00 committed by GitHub
parent b33a9fc9e7
commit 893d14ef8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,8 @@ fn main() {
util.launch_tool(false, 'vrepl')
return
}
if args.len > 0 && (args[0] in ['version', '-V', '-version', '--version'] || (args[0] == '-v' && args.len == 1) ) {
os_args := os.args[1..]
if os_args.len > 0 && (os_args[0] in ['version', '-V', '-version', '--version'] || (os_args[0] == '-v' && os_args.len == 1) ) {
// `-v` flag is for setting verbosity, but without any args it prints the version, like Clang
println(util.full_v_version())
return