Add input function completions for the commandline builtin

darcs-hash:20070930074204-75c98-670704072134326d281626dcc6c1e7dc5be66140.gz
This commit is contained in:
liljencrantz 2007-09-30 17:42:04 +10:00
parent feec9579c2
commit 5870ee7723
2 changed files with 24 additions and 0 deletions

View file

@ -16,3 +16,4 @@ complete -c commandline -s o -l tokenize --description "Print each token on a se
complete -c commandline -s I -l input --description "Specify command to operate on"
complete -c commandline -s C -l cursor --description "Set/get cursor position, not buffer contents"
complete -c commandline -n __fish_commandline_test -a '(bind --function-names)' -d 'Function name' -x

View file

@ -0,0 +1,23 @@
function __fish_commandline_test
set -l is_function no
for i in (commandline -poc)
switch $i
case -f --f --fu --fun --func --funct --functi --functio --function
set is_function yes
case --
break
end
end
switch $is_function
case yes
return 0
end
return 1
end