From c7ec71cd06a943a32129c785d725e3ecd72b4dfc Mon Sep 17 00:00:00 2001 From: Ned <7358345+nedpals@users.noreply.github.com> Date: Tue, 19 Jul 2022 15:52:39 +0800 Subject: [PATCH] tools/vls: skip 'ls' argument on `v ls` (#15126) --- cmd/tools/vls.v | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/tools/vls.v b/cmd/tools/vls.v index 02da3a12e1..5a8664f09a 100644 --- a/cmd/tools/vls.v +++ b/cmd/tools/vls.v @@ -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 {