- "task version" command now reports unrecognized configuration variables,

which may be spelling mistakes or deprecated variables.
This commit is contained in:
Paul Beckingham 2008-11-08 23:32:29 -05:00
parent 8d920f9dc4
commit ecdfb31553
4 changed files with 50 additions and 0 deletions

View file

@ -7,6 +7,8 @@
+ "task stop" can now remove the start time from a started task.
+ "task ghistory" now displays a differently aligned graph, allowing
easier comparison by month of tasks added versus completed and deleted.
+ "task version" command now reports unrecognized configuration variables,
which may be spelling mistakes or deprecated variables.
------ old releases ------------------------------

View file

@ -316,6 +316,16 @@ ID Project Pri Description
whenever the shadow file is updated by some task command.
</dd>
<p>
Note that the command:
</p>
<pre><code>task version</code></pre>
<p>
will display the configuration variables found in the .taskrc file,
and will warn you of any variables that are not recognized.
</p>
</div>
<br />

View file

@ -100,6 +100,8 @@
<li>"task stop" can remove the start time from a started task.
<li>"task ghistory" now displays a differently aligned graph, allowing
easier comparison by month of tasks added versus completed and deleted.
<li>"task version" command now reports unrecognized configuration variables,
which may be spelling mistakes or deprecated variables.
</ul>
<p>

View file

@ -355,6 +355,42 @@ std::string handleVersion (Config& conf)
<< link.render ()
<< std::endl;
// Complain about configuration variables that are not recognized.
// These are the regular configuration variables.
std::string recognized =
"blanklines color color.active color.due color.overdue color.pri.H "
"color.pri.L color.pri.M color.pri.none color.tagged confirmation curses "
"data.location dateformat default.command default.priority defaultwidth due "
"monthsperline nag newest next oldest project shadow.command shadow.file "
"shadow.notify";
std::vector <std::string> unrecognized;
foreach (i, all)
{
if (recognized.find (*i) == std::string::npos)
{
// These are special configuration variables, because their name is
// dynamic.
if (i->find ("color.keyword.") == std::string::npos &&
i->find ("color.project.") == std::string::npos &&
i->find ("color.tag.") == std::string::npos)
{
unrecognized.push_back (*i);
}
}
}
if (unrecognized.size ())
{
out << "Your .taskrc file contains these unrecognized variables:"
<< std::endl;
foreach (i, unrecognized)
out << " " << *i << std::endl;
out << std::endl;
}
// Verify installation. This is mentioned in the documentation as the way to
// ensure everything is properly installed.