From cc816997a427e64cae56b41cc836ebf6d103dadb Mon Sep 17 00:00:00 2001 From: axel Date: Sun, 16 Oct 2005 21:37:49 +1000 Subject: [PATCH] Update __fish_contains_opt to new scoping rules darcs-hash:20051016113749-ac50b-aa65aa5de02dd362b98f078bc4c092e701d239d7.gz --- init/fish_complete.fish | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/init/fish_complete.fish b/init/fish_complete.fish index 8a566a3b3..15ee35ea9 100644 --- a/init/fish_complete.fish +++ b/init/fish_complete.fish @@ -118,15 +118,15 @@ end function __fish_contains_opt -d "Checks if a specific option has been given in the current commandline" - set -l next_short "" + set -l next_short - set -e short_opt - set -e long_opt + set -l short_opt + set -l long_opt for i in $argv - if test $next_short = 1 - set next_short "" - set -g short_opt $short_opt $i + if test $next_short + set next_short + set -- short_opt $short_opt $i else switch $i case -s @@ -136,14 +136,11 @@ function __fish_contains_opt -d "Checks if a specific option has been given in t return 1 case '**' - set -g -- long_opt $long_opt $i + set -- long_opt $long_opt $i end end end - set -l short_opt - set -l long_opt - for i in $short_opt # echo >&2 Test short option \'$i\'