Skip to content

Commit

Permalink
Search task by command
Browse files Browse the repository at this point in the history
  • Loading branch information
setaou committed Sep 22, 2023
1 parent c4dbba4 commit fef547f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions js/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ monetaFilters.filter('taskfilter', function ($filter) {
return S(task.name).latinise().toLowerCase().contains(title);
}

function match_command(task, command)
{
return S(task.command).latinise().toLowerCase().contains(command);
}

function xor(a,b)
{
return ( a || b ) && !( a && b );
Expand Down Expand Up @@ -74,6 +79,12 @@ monetaFilters.filter('taskfilter', function ($filter) {
if (xor(negate, !match_title(task, item)))
return;
}
else if (item.lastIndexOf('command:', 0) === 0)
{
item = item.substr(8);
if (xor(negate, !match_command(task, item)))
return;
}
else if (item.lastIndexOf('enabled:', 0) === 0)
{
item = item.substr(8);
Expand Down

0 comments on commit fef547f

Please sign in to comment.