mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-04 18:30:55 +08:00
Update __fish_contains_opt to new scoping rules
darcs-hash:20051016113749-ac50b-aa65aa5de02dd362b98f078bc4c092e701d239d7.gz
This commit is contained in:
parent
c3c6ea0cb1
commit
cc816997a4
@ -118,15 +118,15 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function __fish_contains_opt -d "Checks if a specific option has been given in the current commandline"
|
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 -l short_opt
|
||||||
set -e long_opt
|
set -l long_opt
|
||||||
|
|
||||||
for i in $argv
|
for i in $argv
|
||||||
if test $next_short = 1
|
if test $next_short
|
||||||
set next_short ""
|
set next_short
|
||||||
set -g short_opt $short_opt $i
|
set -- short_opt $short_opt $i
|
||||||
else
|
else
|
||||||
switch $i
|
switch $i
|
||||||
case -s
|
case -s
|
||||||
@ -136,14 +136,11 @@ function __fish_contains_opt -d "Checks if a specific option has been given in t
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
case '**'
|
case '**'
|
||||||
set -g -- long_opt $long_opt $i
|
set -- long_opt $long_opt $i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l short_opt
|
|
||||||
set -l long_opt
|
|
||||||
|
|
||||||
for i in $short_opt
|
for i in $short_opt
|
||||||
|
|
||||||
# echo >&2 Test short option \'$i\'
|
# echo >&2 Test short option \'$i\'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user