2017-02-05 11:49:39 +08:00
|
|
|
set -l builtin_packages {$OMF_PATH,$OMF_CONFIG}/pkg*/{omf,fish-spec}
|
2015-10-07 04:31:44 +08:00
|
|
|
|
|
|
|
|
2017-02-05 11:49:39 +08:00
|
|
|
function omf.packages.list -d 'List installed packages'
|
|
|
|
set -l show_plugins
|
|
|
|
set -l show_themes
|
2015-10-07 04:31:44 +08:00
|
|
|
|
2017-02-05 11:49:39 +08:00
|
|
|
if begin; contains -- --plugin $argv; or contains -- -p $argv; end
|
|
|
|
set -e show_themes
|
2015-10-07 04:31:44 +08:00
|
|
|
end
|
|
|
|
|
2017-02-05 11:49:39 +08:00
|
|
|
if begin; contains -- --theme $argv; or contains -- -t $argv; end
|
|
|
|
set show_themes
|
|
|
|
set -e show_plugins
|
2015-10-07 04:31:44 +08:00
|
|
|
end
|
|
|
|
|
2017-02-05 11:49:39 +08:00
|
|
|
set -l plugins_paths $OMF_PATH/pkg/*
|
|
|
|
set -l themes_paths $OMF_PATH/themes/*
|
2015-10-07 04:31:44 +08:00
|
|
|
|
2017-02-05 11:49:39 +08:00
|
|
|
if set -q show_plugins
|
|
|
|
for path in $plugins_paths
|
|
|
|
contains $path $builtin_packages; or command basename $path
|
|
|
|
end
|
2015-10-07 04:31:44 +08:00
|
|
|
end
|
|
|
|
|
2017-02-05 11:49:39 +08:00
|
|
|
if set -q show_themes
|
|
|
|
for path in $themes_paths
|
|
|
|
command basename $path
|
|
|
|
end
|
2015-10-07 04:31:44 +08:00
|
|
|
end
|
|
|
|
end
|