context: Do not allow show, list or none as new context names
- Thanks to silviof.
This commit is contained in:
@@ -137,6 +137,12 @@ void CmdContext::defineContext (const std::vector <std::string>& words, std::str
|
|||||||
auto name = "context." + words[1];
|
auto name = "context." + words[1];
|
||||||
auto value = joinWords (words, 2);
|
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
|
// Check if the value is a proper filter by filtering current pending.data
|
||||||
Filter filter;
|
Filter filter;
|
||||||
std::vector <Task> filtered;
|
std::vector <Task> filtered;
|
||||||
|
|||||||
@@ -528,6 +528,7 @@
|
|||||||
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
|
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
|
||||||
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
||||||
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
||||||
|
#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name."
|
||||||
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
||||||
|
|||||||
@@ -526,6 +526,7 @@
|
|||||||
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definition aborted."
|
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definition aborted."
|
||||||
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
||||||
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
||||||
|
#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name."
|
||||||
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
||||||
|
|||||||
@@ -528,6 +528,7 @@
|
|||||||
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
|
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
|
||||||
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
||||||
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
||||||
|
#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name."
|
||||||
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
||||||
|
|||||||
@@ -540,6 +540,7 @@
|
|||||||
#define STRING_CMD_CONTEXT_DEF_ABRT "Definición de contexto abortada."
|
#define STRING_CMD_CONTEXT_DEF_ABRT "Definición de contexto abortada."
|
||||||
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Validación de filtro fallida: {1}"
|
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Validación de filtro fallida: {1}"
|
||||||
#define STRING_CMD_CONTEXT_DEF_CONF "El filtro '{1}' coincide con 0 tareas pendientes. ¿Quiere continuar?"
|
#define STRING_CMD_CONTEXT_DEF_CONF "El filtro '{1}' coincide con 0 tareas pendientes. ¿Quiere continuar?"
|
||||||
|
#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name."
|
||||||
#define STRING_CMD_CONTEXT_DEL_SUCC "Contexto '{1}' eliminado."
|
#define STRING_CMD_CONTEXT_DEL_SUCC "Contexto '{1}' eliminado."
|
||||||
#define STRING_CMD_CONTEXT_DEL_FAIL "Contexto '{1}' no eliminado."
|
#define STRING_CMD_CONTEXT_DEL_FAIL "Contexto '{1}' no eliminado."
|
||||||
#define STRING_CMD_CONTEXT_DEL_USAG "El nombre del contexto necesita ser especificado."
|
#define STRING_CMD_CONTEXT_DEL_USAG "El nombre del contexto necesita ser especificado."
|
||||||
|
|||||||
@@ -530,6 +530,7 @@
|
|||||||
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
|
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
|
||||||
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
||||||
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
||||||
|
#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name."
|
||||||
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
||||||
|
|||||||
@@ -529,6 +529,7 @@
|
|||||||
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
|
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
|
||||||
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
||||||
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
||||||
|
#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name."
|
||||||
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
||||||
|
|||||||
@@ -530,6 +530,7 @@
|
|||||||
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
|
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
|
||||||
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
||||||
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
||||||
|
#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name."
|
||||||
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
||||||
|
|||||||
@@ -530,6 +530,7 @@
|
|||||||
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
|
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
|
||||||
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
||||||
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
||||||
|
#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name."
|
||||||
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
||||||
|
|||||||
@@ -530,6 +530,7 @@
|
|||||||
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
|
#define STRING_CMD_CONTEXT_DEF_ABRT "Context definiton aborted."
|
||||||
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
#define STRING_CMD_CONTEXT_DEF_ABRT2 "Filter validation failed: {1}"
|
||||||
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
#define STRING_CMD_CONTEXT_DEF_CONF "The filter '{1}' matches 0 pending tasks. Do you wish to continue?"
|
||||||
|
#define STRING_CMD_CONTEXT_DEF_INVLD "The name '{1}' is reserved and not allowed to use as a context name."
|
||||||
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
#define STRING_CMD_CONTEXT_DEL_SUCC "Context '{1}' deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
#define STRING_CMD_CONTEXT_DEL_FAIL "Context '{1}' not deleted."
|
||||||
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
#define STRING_CMD_CONTEXT_DEL_USAG "Context name needs to be specified."
|
||||||
|
|||||||
Submodule src/libshared updated: f1a3cd6bfa...198dcd3685
Reference in New Issue
Block a user