mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-21 14:47:14 +08:00

Replace package database with independently installed package repositories - Add support for fetching and installing from package repositories containing package URLs and metadata - Support multiple package repository sources - Add new repo command - Remove submit command - Enhance describe and search commands - Fix and improve help text for new and adjusted commands - Fix bundle install exit status - Refer to plugins as "plugins" instead of the general term "packages" - Code clarity improvements - Put plugin/theme distinction into package metadata
39 lines
931 B
Fish
39 lines
931 B
Fish
function omf.cli.search -d 'Searches all available packages'
|
|
switch (count $argv);
|
|
case 1;
|
|
omf.index.update --if-missing
|
|
|
|
echo (omf::under)"Plugins"(omf::off)
|
|
__omf.cli.search.output --type=plugin --text=$argv[1]
|
|
echo
|
|
echo (omf::under)"Themes"(omf::off)
|
|
__omf.cli.search.output --type=theme --text=$argv[1]
|
|
|
|
case 2;
|
|
omf.index.update --if-missing
|
|
|
|
switch "$argv[1]"
|
|
case "-p" "--plugin";
|
|
__omf.cli.search.output --type=plugin --text=$argv[2]
|
|
case "-t" "--theme";
|
|
__omf.cli.search.output --type=theme --text=$argv[2]
|
|
case '*';
|
|
omf.cli.help search
|
|
return 1
|
|
end
|
|
|
|
case '*';
|
|
omf.cli.help search
|
|
return 1
|
|
end
|
|
|
|
return 0
|
|
end
|
|
|
|
function __omf.cli.search.output
|
|
for package in (omf.index.query $argv)
|
|
set -l desc (omf.index.stat $package description)
|
|
echo "$package - $desc"
|
|
end
|
|
end
|