describe works on installed packages

also modified list_db_packages to return all packages by default, but with a
skip_installed to skip listing installed packages
This commit is contained in:
Sheldon Els 2015-08-30 18:22:39 +02:00
parent 0a32588f4b
commit 633e52101b
3 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,11 @@
# List all packages available to install from the registry.
function omf.list_db_packages
function omf.list_db_packages -a skip_installed
for item in (basename $OMF_PATH/db/pkg/*)
contains $item (basename {$OMF_PATH,$OMF_CONFIG}/pkg/*); or echo $item
if begin
test -z $skip_installed
or not contains $item (basename {$OMF_PATH,$OMF_CONFIG}/pkg/*)
end
echo $item
end
end
end

View File

@ -16,7 +16,7 @@ complete -c omf -n "__omf.opt_is q query" -a (printf "%s " (set | awk '{
complete -c omf -n "__omf.opt_is r rm remove" -a (printf "%s " (omf.list_local_packages) (omf.list_installed_themes))
complete -c omf -n "__omf.opt_is d desc describe" -a (printf "%s " (omf.list_db_packages))
complete -c omf -n "__omf.opt_is c cd" -a (printf "%s " (omf.list_db_packages))
complete -c omf -n "__omf.opt_is i install" -a (printf "%s " (omf.list_db_packages))
complete -c omf -n "__omf.opt_is i install" -a (printf "%s " (omf.list_db_packages "skip installed packages"))
complete -c omf -n "__omf.opt_is t theme" -a (printf "%s " (omf.list_themes))
complete -c omf -n "__omf.opt_is help" -a "install theme remove update list describe cd new submit query destroy"

View File

@ -89,7 +89,7 @@ function omf -d "Oh My Fish"
case "i" "install" "get"
if test (count $argv) -eq 1
omf.list_db_packages | column
omf.list_db_packages "skip installed packages" | column
else
omf.install_package $argv[2..-1]
refresh