mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 04:58:57 +00:00
Add apt-cache completion for package names
Signed-off-by: Gustavo Noronha Silva <kov@kov.eti.br>
This commit is contained in:
parent
e52cf09bc1
commit
be3fff9282
1 changed files with 11 additions and 0 deletions
|
@ -29,3 +29,14 @@ complete -f -c apt-cache -s v -l version --description "Display version and exit
|
|||
complete -r -c apt-cache -s c -l config-file --description "Specify config file"
|
||||
complete -x -c apt-cache -s o -l option --description "Specify options"
|
||||
|
||||
function __fish_apt-cache_use_package --description 'Test if apt command should have packages as potential completion'
|
||||
for i in (commandline -opc)
|
||||
if contains -- $i contains show showpkg showsrc depends rdepends dotty policy
|
||||
return 0
|
||||
end
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
complete -c apt-cache -n '__fish_apt-cache_use_package' -a '(__fish_print_packages)' --description 'Package'
|
||||
|
||||
|
|
Loading…
Reference in a new issue