mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Add input function completions for the commandline builtin
darcs-hash:20070930074204-75c98-670704072134326d281626dcc6c1e7dc5be66140.gz
This commit is contained in:
parent
feec9579c2
commit
5870ee7723
2 changed files with 24 additions and 0 deletions
|
@ -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
|
||||
|
|
23
share/functions/__fish_commandline_test.fish
Normal file
23
share/functions/__fish_commandline_test.fish
Normal 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
|
Loading…
Reference in a new issue