cmd/v: process version argument correctly

pull/4404/head^2
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
1 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,8 @@ fn main() {
util.launch_tool(false, 'vrepl') util.launch_tool(false, 'vrepl')
return 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 // `-v` flag is for setting verbosity, but without any args it prints the version, like Clang
println(util.full_v_version()) println(util.full_v_version())
return return