mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
share/completions/env: Fix
This completed the commandline with options removed, which looked like env VAR=VAL command option Which didn't really actually work. Fixes #5856. [ci skip]
This commit is contained in:
parent
649d3ac101
commit
411b4aea9d
1 changed files with 14 additions and 0 deletions
|
@ -1,6 +1,20 @@
|
|||
function __fish_complete_env_subcommand
|
||||
argparse -s s/ignore-environment u/unset h-help v-version -- (commandline -opc) (commandline -ct) 2>/dev/null
|
||||
or return
|
||||
|
||||
# argv[1] is `env` or an alias.
|
||||
set -e argv[1]
|
||||
|
||||
# Remove all VAR=VAL arguments up to the first that isn't
|
||||
while set -q argv[1]
|
||||
if string match -q '*=*' -- $argv[1]
|
||||
set -e argv[1]
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
# Then complete the rest as if it was given as a command.
|
||||
if set -q argv[1]
|
||||
complete -C"$argv"
|
||||
return 0
|
||||
|
|
Loading…
Reference in a new issue