2007-09-26 00:14:47 +08:00
|
|
|
|
|
|
|
function __fish_bind_test1
|
2012-06-16 08:30:10 +08:00
|
|
|
set -l args
|
|
|
|
set -l use_keys no
|
|
|
|
for i in (commandline -poc)
|
|
|
|
switch $i
|
|
|
|
case -k --k --ke --key
|
2016-11-28 13:27:22 +08:00
|
|
|
set use_keys yes
|
2007-09-26 00:14:47 +08:00
|
|
|
|
2012-06-16 08:30:10 +08:00
|
|
|
case "-*"
|
2007-09-26 00:14:47 +08:00
|
|
|
|
2012-06-16 08:30:10 +08:00
|
|
|
case "*"
|
2016-11-28 13:27:22 +08:00
|
|
|
set args $args $i
|
2012-06-16 08:30:10 +08:00
|
|
|
end
|
|
|
|
end
|
2007-09-26 00:14:47 +08:00
|
|
|
|
2012-06-16 08:30:10 +08:00
|
|
|
switch $use_keys
|
|
|
|
case yes
|
2016-11-28 13:27:22 +08:00
|
|
|
switch (count $args)
|
|
|
|
case 1
|
|
|
|
return 0
|
|
|
|
end
|
2012-06-16 08:30:10 +08:00
|
|
|
end
|
|
|
|
return 1
|
2007-09-26 00:14:47 +08:00
|
|
|
end
|