parent
4b541ec0a1
commit
15e9af84b1
@ -0,0 +1,26 @@
|
||||
function omf.cli.search -d "CLI parser for the search command"
|
||||
|
||||
switch (count $argv);
|
||||
case 1;
|
||||
omf.search.pkg $argv[1]
|
||||
echo
|
||||
omf.search.theme $argv[1]
|
||||
case 2;
|
||||
switch "$argv[1]"
|
||||
case "-pkg" "--package";
|
||||
omf.search.pkg $argv[2]
|
||||
case "-t" "--theme";
|
||||
omf.search.theme $argv[2]
|
||||
case '*';
|
||||
__omf.cli.search.usage
|
||||
end
|
||||
case '*';
|
||||
__omf.cli.search.usage
|
||||
end
|
||||
end
|
||||
|
||||
function __omf.cli.search.usage -d "Print usage"
|
||||
|
||||
echo (omf::err)"Usage: omf search ([-t | --theme]) ([-pkg | --package]) item"(omf::off)
|
||||
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
function omf.search.pkg -a item -d "Search db/pkg for the specified item"
|
||||
|
||||
set -l available_pkg (omf.packages.list --database --plugin)
|
||||
echo (omf::under)"Packages"(omf::off)
|
||||
|
||||
set -l regex "([A-Za-z0-9-]*)($item)([A-Za-z0-9-]*)"
|
||||
|
||||
echo $available_pkg | egrep -io $regex | column
|
||||
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
function omf.search.theme -a item -d "Search db/theme for the specified item"
|
||||
|
||||
set -l available_theme (omf.packages.list --database --theme)
|
||||
echo (omf::under)"Themes"(omf::off)
|
||||
|
||||
set -l regex "([A-Za-z0-9-]*)($item)([A-Za-z0-9-]*)"
|
||||
|
||||
echo $available_theme | egrep -io $regex | column
|
||||
|
||||
end
|
Loading…
Reference in New Issue