2017-02-04 21:49:39 -06:00
|
|
|
function omf.cli.search -d 'Searches all available packages'
|
2016-05-11 19:29:50 +01:00
|
|
|
switch (count $argv);
|
|
|
|
case 1;
|
2017-02-04 21:49:39 -06:00
|
|
|
omf.index.update --if-missing
|
|
|
|
|
|
|
|
echo (omf::under)"Plugins"(omf::off)
|
|
|
|
__omf.cli.search.output --type=plugin --text=$argv[1]
|
2016-05-11 19:29:50 +01:00
|
|
|
echo
|
2017-02-04 21:49:39 -06:00
|
|
|
echo (omf::under)"Themes"(omf::off)
|
|
|
|
__omf.cli.search.output --type=theme --text=$argv[1]
|
|
|
|
|
2016-05-11 19:29:50 +01:00
|
|
|
case 2;
|
2017-02-04 21:49:39 -06:00
|
|
|
omf.index.update --if-missing
|
|
|
|
|
2016-05-11 19:29:50 +01:00
|
|
|
switch "$argv[1]"
|
2017-02-04 21:49:39 -06:00
|
|
|
case "-p" "--plugin";
|
|
|
|
__omf.cli.search.output --type=plugin --text=$argv[2]
|
2016-05-11 19:29:50 +01:00
|
|
|
case "-t" "--theme";
|
2017-02-04 21:49:39 -06:00
|
|
|
__omf.cli.search.output --type=theme --text=$argv[2]
|
2016-05-11 19:29:50 +01:00
|
|
|
case '*';
|
2017-02-04 21:49:39 -06:00
|
|
|
omf.cli.help search
|
|
|
|
return 1
|
2016-05-11 19:29:50 +01:00
|
|
|
end
|
2017-02-04 21:49:39 -06:00
|
|
|
|
2016-05-11 19:29:50 +01:00
|
|
|
case '*';
|
2017-02-04 21:49:39 -06:00
|
|
|
omf.cli.help search
|
|
|
|
return 1
|
2016-05-11 19:29:50 +01:00
|
|
|
end
|
|
|
|
|
2017-02-04 21:49:39 -06:00
|
|
|
return 0
|
|
|
|
end
|
2016-05-11 19:29:50 +01:00
|
|
|
|
2017-02-04 21:49:39 -06:00
|
|
|
function __omf.cli.search.output
|
|
|
|
for package in (omf.index.query $argv)
|
|
|
|
set -l desc (omf.index.stat $package description)
|
|
|
|
echo "$package - $desc"
|
|
|
|
end
|
2016-05-11 19:29:50 +01:00
|
|
|
end
|