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

tools/vls: skip 'ls' argument on v ls (#15126)

This commit is contained in:
Ned 2022-07-19 15:52:39 +08:00 committed by GitHub
parent 02925cecd1
commit c7ec71cd06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -431,6 +431,17 @@ fn main() {
fp.application('v ls')
fp.description('Installs, updates, and executes the V language server program')
fp.version('0.1')
// just to make sure whenever user wants to
// interact directly with the executable
// instead of the usual `v ls` command
if fp.args.len >= 2 && fp.args[0..2] == [os.executable(), 'ls'] {
// skip the executable here, the next skip_executable
// outside the if statement will skip the `ls` part
fp.skip_executable()
}
// skip the executable or the `ls` part
fp.skip_executable()
upd.parse(mut fp) or {