Open theonesean opened 5 years ago
filter
is the better nomenclature here.
We should handle multiple filter options; in the config file, these could be represented as filter*
, much like the match*
settings are named.
Adding a reference to the parent list in the task struct might be the best way to handle the list filtering, that way we can make a generic "filter" functionality that just checks all the tasks rather than implementing something specifically for lists. Unsure how "empty" behavior should work, though, especially for labels / assignees in providers where that concept might not exist...
In the case of task assignment, we should probably have a general shared concept of "you" that's defined by each provider; I know the GitHub API has a /user
endpoint that can be used to check the owner of an auth token. This should be preferred to specifying who "you" are in the config file, in case we want to support some kind of easier OAuth flow for new users in the future.
Current filters we should support:
filterList
- filter tasks by list name
filterLabel
- filter tasks by label; issue labels in github, trello labels, etc
filterAssignee
- filter tasks by the people (there can be multiple people) they're assigned to
These can be specified through the command line using e.g. --set filterList=Done
; we can specify an alias (like -f
) for that once we have a more defined argument parsing method.
This would allow the user to filter out lists with titles like "Done" or "Archive", or to positively select lists that match a certain string.
Command-Line Flag
aight -f <string, arbitrary list, or regex>
: will only display lists whose titles match/do not match the specified string/strings/regex. Regex has an inversion option, but if users are using plain string-matching, prepending the string with!
will cause an inverse match. For examples,aight -f !pizza
will only match lists whose header does not include the word "pizza". If you have exclamation points in your string that you want to be tested for matching, escape them with\!
.Configuration Setting
In a provider-match, setting
filterLists=<string ,comma-separated list, or regex>
will automatically filter out lists whose titles don't match. Same inversion and escape rules apply.Potential Extensions
This is for a separate issue, but we could also implement task-level filtering and search.
aight -s "dog food"
would match all tasks that contain the phrase "dog food".