Fix some issues in __fish_complete_subcommand.fish

Fix 'string length: Unknown option': add `--` before $subcommand

Fix count $subcommand always = 1 with `sudo` and `doas`:
give argv as array to __fish_complete_subcommand

[ci skip]
This commit is contained in:
Akatsuki
2019-11-16 14:50:54 +08:00
committed by Johannes Altmanninger
parent 330f1701d7
commit cb72a33e0c
4 changed files with 6 additions and 7 deletions

View File

@@ -24,7 +24,7 @@ function __fish_complete_subcommand -d "Complete subcommand" --no-scope-shadowin
end
set -l options_with_param $argv
if not string length -q $subcommand
if not string length -q -- $subcommand
set cmd (commandline -cop) (commandline -ct)
while set -q cmd[1]
set -l token $cmd[1]
@@ -55,4 +55,3 @@ function __fish_complete_subcommand -d "Complete subcommand" --no-scope-shadowin
end
end