mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-30 11:27:19 +02:00
Bug Fix - Problem with #320
- The new auto-info command interfered with task modification. Should have run all the unit tests before committing that change. - Added auto-info command to the help text.
This commit is contained in:
parent
67ffd07312
commit
336a4dea01
2 changed files with 26 additions and 5 deletions
|
@ -526,6 +526,7 @@ void Context::parse (
|
||||||
bool terminated = false;
|
bool terminated = false;
|
||||||
bool foundSequence = false;
|
bool foundSequence = false;
|
||||||
bool foundSomethingAfterSequence = false;
|
bool foundSomethingAfterSequence = false;
|
||||||
|
bool foundNonSequence = false;
|
||||||
|
|
||||||
foreach (arg, parseArgs)
|
foreach (arg, parseArgs)
|
||||||
{
|
{
|
||||||
|
@ -558,6 +559,8 @@ void Context::parse (
|
||||||
if (foundSequence)
|
if (foundSequence)
|
||||||
foundSomethingAfterSequence = true;
|
foundSomethingAfterSequence = true;
|
||||||
|
|
||||||
|
foundNonSequence = true;
|
||||||
|
|
||||||
if (arg->find (',') != std::string::npos)
|
if (arg->find (',') != std::string::npos)
|
||||||
throw stringtable.get (TAGS_NO_COMMA,
|
throw stringtable.get (TAGS_NO_COMMA,
|
||||||
"Tags are not permitted to contain commas.");
|
"Tags are not permitted to contain commas.");
|
||||||
|
@ -575,6 +578,8 @@ void Context::parse (
|
||||||
if (foundSequence)
|
if (foundSequence)
|
||||||
foundSomethingAfterSequence = true;
|
foundSomethingAfterSequence = true;
|
||||||
|
|
||||||
|
foundNonSequence = true;
|
||||||
|
|
||||||
if (arg->find (',') != std::string::npos)
|
if (arg->find (',') != std::string::npos)
|
||||||
throw stringtable.get (TAGS_NO_COMMA,
|
throw stringtable.get (TAGS_NO_COMMA,
|
||||||
"Tags are not permitted to contain commas.");
|
"Tags are not permitted to contain commas.");
|
||||||
|
@ -589,6 +594,8 @@ void Context::parse (
|
||||||
if (foundSequence)
|
if (foundSequence)
|
||||||
foundSomethingAfterSequence = true;
|
foundSomethingAfterSequence = true;
|
||||||
|
|
||||||
|
foundNonSequence = true;
|
||||||
|
|
||||||
attribute.parse (*arg);
|
attribute.parse (*arg);
|
||||||
|
|
||||||
// There has to be a better way. And it starts with a fresh coffee.
|
// There has to be a better way. And it starts with a fresh coffee.
|
||||||
|
@ -618,6 +625,8 @@ void Context::parse (
|
||||||
if (foundSequence)
|
if (foundSequence)
|
||||||
foundSomethingAfterSequence = true;
|
foundSomethingAfterSequence = true;
|
||||||
|
|
||||||
|
foundNonSequence = true;
|
||||||
|
|
||||||
if (descCandidate.length ())
|
if (descCandidate.length ())
|
||||||
descCandidate += " ";
|
descCandidate += " ";
|
||||||
descCandidate += *arg;
|
descCandidate += *arg;
|
||||||
|
@ -630,6 +639,8 @@ void Context::parse (
|
||||||
if (foundSequence)
|
if (foundSequence)
|
||||||
foundSomethingAfterSequence = true;
|
foundSomethingAfterSequence = true;
|
||||||
|
|
||||||
|
foundNonSequence = true;
|
||||||
|
|
||||||
debug ("parse subst '" + *arg + "'");
|
debug ("parse subst '" + *arg + "'");
|
||||||
parseSubst.parse (*arg);
|
parseSubst.parse (*arg);
|
||||||
}
|
}
|
||||||
|
@ -643,6 +654,8 @@ void Context::parse (
|
||||||
|
|
||||||
if (foundSequence)
|
if (foundSequence)
|
||||||
foundSomethingAfterSequence = true;
|
foundSomethingAfterSequence = true;
|
||||||
|
|
||||||
|
foundNonSequence = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Anything else is just considered description.
|
// Anything else is just considered description.
|
||||||
|
@ -651,6 +664,8 @@ void Context::parse (
|
||||||
if (foundSequence)
|
if (foundSequence)
|
||||||
foundSomethingAfterSequence = true;
|
foundSomethingAfterSequence = true;
|
||||||
|
|
||||||
|
foundNonSequence = true;
|
||||||
|
|
||||||
if (descCandidate.length ())
|
if (descCandidate.length ())
|
||||||
descCandidate += " ";
|
descCandidate += " ";
|
||||||
descCandidate += *arg;
|
descCandidate += *arg;
|
||||||
|
@ -675,6 +690,8 @@ void Context::parse (
|
||||||
debug ("parse description '" + descCandidate + "'");
|
debug ("parse description '" + descCandidate + "'");
|
||||||
parseTask.set ("description", descCandidate);
|
parseTask.set ("description", descCandidate);
|
||||||
|
|
||||||
|
foundNonSequence = true;
|
||||||
|
|
||||||
// Now convert the description to a filter on each word, if necessary.
|
// Now convert the description to a filter on each word, if necessary.
|
||||||
if (parseCmd.isReadOnlyCommand ())
|
if (parseCmd.isReadOnlyCommand ())
|
||||||
{
|
{
|
||||||
|
@ -730,10 +747,10 @@ void Context::parse (
|
||||||
"You must specify a command, or a task ID to modify");
|
"You must specify a command, or a task ID to modify");
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the command "task 123" is entered, then the actual command is assumed
|
// If the command "task 123" is entered, but with no modifier arguments,
|
||||||
// to be "info".
|
// then the actual command is assumed to be "info".
|
||||||
else if (parseTask.id != 0 ||
|
else if (!foundNonSequence &&
|
||||||
parseSequence.size () != 0)
|
(parseTask.id != 0 || parseSequence.size () != 0))
|
||||||
{
|
{
|
||||||
std::cout << "No command - assuming 'info'." << std::endl;
|
std::cout << "No command - assuming 'info'." << std::endl;
|
||||||
parseCmd.command = "info";
|
parseCmd.command = "info";
|
||||||
|
|
|
@ -100,6 +100,10 @@ int shortUsage (std::string &outs)
|
||||||
"substitutions for all matching text, not just the "
|
"substitutions for all matching text, not just the "
|
||||||
"first occurrence.");
|
"first occurrence.");
|
||||||
|
|
||||||
|
row = table.addRow ();
|
||||||
|
table.addCell (row, 1, "task ID");
|
||||||
|
table.addCell (row, 2, "Specifying an ID without a command invokes the 'info' command.");
|
||||||
|
|
||||||
row = table.addRow ();
|
row = table.addRow ();
|
||||||
table.addCell (row, 1, "task edit ID");
|
table.addCell (row, 1, "task edit ID");
|
||||||
table.addCell (row, 2, "Launches an editor to let you modify all aspects of a task directly, therefore it is to be used carefully.");
|
table.addCell (row, 2, "Launches an editor to let you modify all aspects of a task directly, therefore it is to be used carefully.");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue