mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
context: Do not allow show, list or none as new context names
- Thanks to silviof.
This commit is contained in:
parent
05979025d2
commit
255e02b7da
11 changed files with 16 additions and 1 deletions
|
@ -137,6 +137,12 @@ void CmdContext::defineContext (const std::vector <std::string>& words, std::str
|
|||
auto name = "context." + words[1];
|
||||
auto value = joinWords (words, 2);
|
||||
|
||||
// Make sure nobody creates a context with name 'list', 'none' or 'show'
|
||||
if (words[1] == "none" or words[1] == "list" or words[1] == "show")
|
||||
{
|
||||
throw format (STRING_CMD_CONTEXT_DEF_INVLD, words[1]);
|
||||
}
|
||||
|
||||
// Check if the value is a proper filter by filtering current pending.data
|
||||
Filter filter;
|
||||
std::vector <Task> filtered;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue