mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Bug Fix - parsing
- Now properly enumerates ambiguous commands. - Now properly enumerates ambiguous colors. - Now displays suitable error when a command like "task x" is entered.
This commit is contained in:
parent
d6168ff6a6
commit
53155fcc34
5 changed files with 11 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -97,8 +97,6 @@ void Cmd::parse (const std::string& input)
|
|||
|
||||
std::string combined;
|
||||
join (combined, ", ", matches);
|
||||
error += combined;
|
||||
|
||||
throw error + combined;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -185,7 +185,6 @@ std::string guessColor (const std::string& name)
|
|||
|
||||
std::string combined;
|
||||
join (combined, ", ", matches);
|
||||
error += combined;
|
||||
|
||||
throw error + combined;
|
||||
}
|
||||
|
|
|
@ -63,6 +63,8 @@
|
|||
|
||||
#define TAGS_NO_COMMA 115
|
||||
|
||||
#define CMD_MISSING 116
|
||||
|
||||
// 2xx Commands
|
||||
#define CMD_ACTIVE 200
|
||||
#define CMD_ADD 201
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue