oh-my-fish/pkg/omf/functions/cli/omf.cli.search.fish
Stephen M. Coakley 2d1deeb5fd Replace package database with independently installed package repositories (#427)
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
2017-02-04 21:49:39 -06:00

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