diff --git a/i18n/strings.en-US b/i18n/strings.en-US index 53c65764f..c17c70afe 100644 --- a/i18n/strings.en-US +++ b/i18n/strings.en-US @@ -26,6 +26,7 @@ 113 Unrecognized character(s) at end of substitution 114 Malformed substitution 115 Tags are not permitted to contain commas +116 You must specify a command, or a task ID to modify # 2xx Commands - must be sequential 200 active diff --git a/src/Cmd.cpp b/src/Cmd.cpp index 1e6919e54..e925e5352 100644 --- a/src/Cmd.cpp +++ b/src/Cmd.cpp @@ -97,8 +97,6 @@ void Cmd::parse (const std::string& input) std::string combined; join (combined, ", ", matches); - error += combined; - throw error + combined; } } diff --git a/src/Context.cpp b/src/Context.cpp index 72c8fe7db..e51da9f96 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -550,7 +550,14 @@ void Context::parse ( parseTask.set ("description", descCandidate); } - // TODO task.validate () ? + // At this point, either a sequence or a command should have been found. + if (parseSequence.size () == 0 && parseCmd.command == "") + { + parseCmd.parse (descCandidate); + throw stringtable.get ( + CMD_MISSING, + "You must specify a command, or a task ID to modify"); + } // Read-only command (reports, status, info ...) use filters. Write commands // (add, done ...) do not. diff --git a/src/color.cpp b/src/color.cpp index 5de690c04..858ac0078 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -185,7 +185,6 @@ std::string guessColor (const std::string& name) std::string combined; join (combined, ", ", matches); - error += combined; throw error + combined; } diff --git a/src/i18n.h b/src/i18n.h index 266998274..36e4c649f 100644 --- a/src/i18n.h +++ b/src/i18n.h @@ -63,6 +63,8 @@ #define TAGS_NO_COMMA 115 +#define CMD_MISSING 116 + // 2xx Commands #define CMD_ACTIVE 200 #define CMD_ADD 201