mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
__fish_complete_path: add new completion, mimics builtin path completion
Completions can now be written which disable file completion and then selectively re-enable it using this function. Closes #834.
This commit is contained in:
parent
84af3dcd18
commit
6ece8523b1
1 changed files with 14 additions and 0 deletions
14
share/functions/__fish_complete_path.fish
Normal file
14
share/functions/__fish_complete_path.fish
Normal file
|
@ -0,0 +1,14 @@
|
|||
function __fish_complete_path --description "Complete using path"
|
||||
set -l target
|
||||
set -l description
|
||||
switch (count $argv)
|
||||
case 0
|
||||
# pass
|
||||
case 1
|
||||
set target "$argv[1]"
|
||||
case 2 "*"
|
||||
set target "$argv[1]"
|
||||
set description "$argv[2]"
|
||||
end
|
||||
printf "%s\t$description\n" (command ls -dp "$target"*)
|
||||
end
|
Loading…
Reference in a new issue