2018-04-04 03:40:51 +08:00
|
|
|
function __fish_seen_argument
|
2019-11-03 03:40:40 +08:00
|
|
|
argparse 's/short=+' 'o/old=+' 'l/long=+' -- $argv
|
2018-04-04 03:40:51 +08:00
|
|
|
|
2020-05-16 03:34:48 +08:00
|
|
|
set -l cmd (commandline -co)
|
2019-05-05 18:09:25 +08:00
|
|
|
set -e cmd[1]
|
|
|
|
for t in $cmd
|
|
|
|
for s in $_flag_s
|
|
|
|
if string match -qr "^-[A-z0-9]*"$s"[A-z0-9]*\$" -- $t
|
|
|
|
return 0
|
|
|
|
end
|
|
|
|
end
|
2018-04-04 03:40:51 +08:00
|
|
|
|
2019-11-03 03:40:40 +08:00
|
|
|
for o in $_flag_o
|
|
|
|
if string match -qr "^-$s\$" -- $t
|
|
|
|
return 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-05-05 18:09:25 +08:00
|
|
|
for l in $_flag_l
|
|
|
|
if string match -q -- "--$l" $t
|
|
|
|
return 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2018-04-04 03:40:51 +08:00
|
|
|
|
2019-05-05 18:09:25 +08:00
|
|
|
return 1
|
2018-04-04 03:40:51 +08:00
|
|
|
end
|