mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Cleanup: Don't use string literals when character literals are needed
This commit is contained in:
parent
5403675100
commit
95f4989f77
58 changed files with 372 additions and 374 deletions
22
src/CLI2.cpp
22
src/CLI2.cpp
|
@ -213,7 +213,7 @@ const std::string A2::dump () const
|
|||
else tags += "\033[32m" + tag + "\033[0m ";
|
||||
}
|
||||
|
||||
return output + " " + atts + tags;
|
||||
return output + ' ' + atts + tags;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -632,7 +632,7 @@ void CLI2::prepareFilter ()
|
|||
if (a.hasTag ("FILTER"))
|
||||
{
|
||||
if (combined != "")
|
||||
combined += " ";
|
||||
combined += ' ';
|
||||
|
||||
combined += a.attribute ("raw");
|
||||
}
|
||||
|
@ -657,7 +657,7 @@ const std::vector <std::string> CLI2::getWords ()
|
|||
Color colorOrigArgs ("gray10 on gray4");
|
||||
std::string message = " ";
|
||||
for (const auto& word : words)
|
||||
message += colorOrigArgs.colorize (word) + " ";
|
||||
message += colorOrigArgs.colorize (word) + ' ';
|
||||
context.debug ("CLI2::getWords" + message);
|
||||
}
|
||||
|
||||
|
@ -737,13 +737,13 @@ const std::string CLI2::dump (const std::string& title) const
|
|||
out << colorFilter.colorize (i->attribute ("raw"));
|
||||
}
|
||||
|
||||
out << "\n";
|
||||
out << '\n';
|
||||
|
||||
if (_args.size ())
|
||||
{
|
||||
out << " _args\n";
|
||||
for (const auto& a : _args)
|
||||
out << " " << a.dump () << "\n";
|
||||
out << " " << a.dump () << '\n';
|
||||
}
|
||||
|
||||
if (_id_ranges.size ())
|
||||
|
@ -752,21 +752,21 @@ const std::string CLI2::dump (const std::string& title) const
|
|||
for (const auto& range : _id_ranges)
|
||||
{
|
||||
if (range.first != range.second)
|
||||
out << colorArgs.colorize (range.first + "-" + range.second) << " ";
|
||||
out << colorArgs.colorize (range.first + "-" + range.second) << ' ';
|
||||
else
|
||||
out << colorArgs.colorize (range.first) << " ";
|
||||
out << colorArgs.colorize (range.first) << ' ';
|
||||
}
|
||||
|
||||
out << "\n";
|
||||
out << '\n';
|
||||
}
|
||||
|
||||
if (_uuid_list.size ())
|
||||
{
|
||||
out << " _uuid_list\n ";
|
||||
for (const auto& uuid : _uuid_list)
|
||||
out << colorArgs.colorize (uuid) << " ";
|
||||
out << colorArgs.colorize (uuid) << ' ';
|
||||
|
||||
out << "\n";
|
||||
out << '\n';
|
||||
}
|
||||
|
||||
return out.str ();
|
||||
|
@ -1242,7 +1242,7 @@ void CLI2::desugarFilterAttributes ()
|
|||
std::vector <A2> values = lexExpression (value);
|
||||
if (context.config.getInteger ("debug.parser") >= 2)
|
||||
{
|
||||
context.debug ("CLI2::lexExpression " + name + ":" + value);
|
||||
context.debug ("CLI2::lexExpression " + name + ':' + value);
|
||||
for (auto& v : values)
|
||||
context.debug (" " + v.dump ());
|
||||
context.debug (" ");
|
||||
|
|
|
@ -308,7 +308,7 @@ Color::operator std::string () const
|
|||
if (_value & _COLOR_BRIGHT)
|
||||
description += std::string (description.length () ? " " : "") + "bright";
|
||||
|
||||
description += " " + bg ();
|
||||
description += ' ' + bg ();
|
||||
}
|
||||
|
||||
return description;
|
||||
|
|
|
@ -489,7 +489,7 @@ void Config::createDefaultRC (const std::string& rc, const std::string& data)
|
|||
std::stringstream contents;
|
||||
contents << "# [Created by "
|
||||
<< PACKAGE_STRING
|
||||
<< " "
|
||||
<< ' '
|
||||
<< now.toString ("m/d/Y H:N:S")
|
||||
<< "]\n"
|
||||
<< _defaults.substr (0, loc + 14)
|
||||
|
@ -509,7 +509,7 @@ void Config::createDefaultRC (const std::string& rc, const std::string& data)
|
|||
<< "#include " << TASK_RCDIR << "/solarized-dark-256.theme\n"
|
||||
<< "#include " << TASK_RCDIR << "/solarized-light-256.theme\n"
|
||||
<< "#include " << TASK_RCDIR << "/no-color.theme\n"
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
// Write out the new file.
|
||||
if (! File::write (rc, contents.str ()))
|
||||
|
|
|
@ -273,9 +273,9 @@ int Context::initialize (int argc, const char** argv)
|
|||
{
|
||||
for (auto& d : debugMessages)
|
||||
if (color ())
|
||||
std::cerr << colorizeDebug (d) << "\n";
|
||||
std::cerr << colorizeDebug (d) << '\n';
|
||||
else
|
||||
std::cerr << d << "\n";
|
||||
std::cerr << d << '\n';
|
||||
}
|
||||
|
||||
// Dump all headers, controlled by 'header' verbosity token.
|
||||
|
@ -283,9 +283,9 @@ int Context::initialize (int argc, const char** argv)
|
|||
{
|
||||
for (auto& h : headers)
|
||||
if (color ())
|
||||
std::cerr << colorizeHeader (h) << "\n";
|
||||
std::cerr << colorizeHeader (h) << '\n';
|
||||
else
|
||||
std::cerr << h << "\n";
|
||||
std::cerr << h << '\n';
|
||||
}
|
||||
|
||||
// Dump all footnotes, controlled by 'footnote' verbosity token.
|
||||
|
@ -293,18 +293,18 @@ int Context::initialize (int argc, const char** argv)
|
|||
{
|
||||
for (auto& f : footnotes)
|
||||
if (color ())
|
||||
std::cerr << colorizeFootnote (f) << "\n";
|
||||
std::cerr << colorizeFootnote (f) << '\n';
|
||||
else
|
||||
std::cerr << f << "\n";
|
||||
std::cerr << f << '\n';
|
||||
}
|
||||
|
||||
// Dump all errors, non-maskable.
|
||||
// Colorized as footnotes.
|
||||
for (auto& e : errors)
|
||||
if (color ())
|
||||
std::cerr << colorizeFootnote (e) << "\n";
|
||||
std::cerr << colorizeFootnote (e) << '\n';
|
||||
else
|
||||
std::cerr << e << "\n";
|
||||
std::cerr << e << '\n';
|
||||
}
|
||||
|
||||
timer_init.stop ();
|
||||
|
@ -329,13 +329,13 @@ int Context::run ()
|
|||
std::stringstream s;
|
||||
s << "Perf "
|
||||
<< PACKAGE_STRING
|
||||
<< " "
|
||||
<< ' '
|
||||
#ifdef HAVE_COMMIT
|
||||
<< COMMIT
|
||||
#else
|
||||
<< "-"
|
||||
<< '-'
|
||||
#endif
|
||||
<< " "
|
||||
<< ' '
|
||||
<< ISO8601d ().toISO ()
|
||||
|
||||
<< " init:" << timer_init.total ()
|
||||
|
@ -356,7 +356,7 @@ int Context::run ()
|
|||
timer_render.total () -
|
||||
timer_hooks.total ()
|
||||
<< " total:" << timer_total.total ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
debug (s.str ());
|
||||
}
|
||||
|
||||
|
@ -383,9 +383,9 @@ int Context::run ()
|
|||
{
|
||||
for (auto& d : debugMessages)
|
||||
if (color ())
|
||||
std::cerr << colorizeDebug (d) << "\n";
|
||||
std::cerr << colorizeDebug (d) << '\n';
|
||||
else
|
||||
std::cerr << d << "\n";
|
||||
std::cerr << d << '\n';
|
||||
}
|
||||
|
||||
// Dump all headers, controlled by 'header' verbosity token.
|
||||
|
@ -393,9 +393,9 @@ int Context::run ()
|
|||
{
|
||||
for (auto& h : headers)
|
||||
if (color ())
|
||||
std::cerr << colorizeHeader (h) << "\n";
|
||||
std::cerr << colorizeHeader (h) << '\n';
|
||||
else
|
||||
std::cerr << h << "\n";
|
||||
std::cerr << h << '\n';
|
||||
}
|
||||
|
||||
// Dump the report output.
|
||||
|
@ -406,18 +406,18 @@ int Context::run ()
|
|||
{
|
||||
for (auto& f : footnotes)
|
||||
if (color ())
|
||||
std::cerr << colorizeFootnote (f) << "\n";
|
||||
std::cerr << colorizeFootnote (f) << '\n';
|
||||
else
|
||||
std::cerr << f << "\n";
|
||||
std::cerr << f << '\n';
|
||||
}
|
||||
|
||||
// Dump all errors, non-maskable.
|
||||
// Colorized as footnotes.
|
||||
for (auto& e : errors)
|
||||
if (color ())
|
||||
std::cerr << colorizeError (e) << "\n";
|
||||
std::cerr << colorizeError (e) << '\n';
|
||||
else
|
||||
std::cerr << e << "\n";
|
||||
std::cerr << e << '\n';
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
@ -819,7 +819,7 @@ void Context::updateXtermTitle ()
|
|||
title += a->attribute ("raw");
|
||||
}
|
||||
|
||||
std::cout << "]0;task " << command << " " << title << "";
|
||||
std::cout << "]0;task " << command << ' ' << title << "";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ bool getDOM (const std::string& name, Variant& value)
|
|||
for (auto& arg : context.cli2._original_args)
|
||||
{
|
||||
if (commandLine != "")
|
||||
commandLine += " ";
|
||||
commandLine += ' ';
|
||||
|
||||
commandLine += arg.attribute("raw");
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ static int verify_certificate_callback (gnutls_session_t);
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
static void gnutls_log_function (int level, const char* message)
|
||||
{
|
||||
std::cout << "c: " << level << " " << message;
|
||||
std::cout << "c: " << level << ' ' << message;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -2144,12 +2144,12 @@ void Task::modify (modType type, bool text_required /* = false */)
|
|||
|
||||
case modPrepend:
|
||||
context.debug (label + "description <-- '" + text + "' + description");
|
||||
set ("description", text + " " + get ("description"));
|
||||
set ("description", text + ' ' + get ("description"));
|
||||
break;
|
||||
|
||||
case modAppend:
|
||||
context.debug (label + "description <-- description + '" + text + "'");
|
||||
set ("description", get ("description") + " " + text);
|
||||
set ("description", get ("description") + ' ' + text);
|
||||
break;
|
||||
|
||||
case modAnnotate:
|
||||
|
|
|
@ -55,7 +55,7 @@ Timer::~Timer ()
|
|||
std::stringstream s;
|
||||
s << "Timer "
|
||||
<< _description
|
||||
<< " "
|
||||
<< ' '
|
||||
<< std::setprecision (6)
|
||||
<< std::fixed
|
||||
<< _total / 1000000.0
|
||||
|
|
28
src/calc.cpp
28
src/calc.cpp
|
@ -57,7 +57,7 @@ int main (int argc, char** argv)
|
|||
|
||||
try
|
||||
{
|
||||
bool infix = true;
|
||||
bool infix {true};
|
||||
|
||||
// Add a source for constants.
|
||||
Eval e;
|
||||
|
@ -69,29 +69,29 @@ int main (int argc, char** argv)
|
|||
for (int i = 1; i < argc; i++)
|
||||
if (!strcmp (argv[i], "-h") || ! strcmp (argv[i], "--help"))
|
||||
{
|
||||
std::cout << "\n"
|
||||
std::cout << '\n'
|
||||
<< "Usage: " << argv[0] << " [options] '<expression>'\n"
|
||||
<< "\n"
|
||||
<< '\n'
|
||||
<< "Options:\n"
|
||||
<< " -h|--help Display this usage\n"
|
||||
<< " -d|--debug Debug mode\n"
|
||||
<< " -i|--infix Infix expression (default)\n"
|
||||
<< " -p|--postfix Postfix expression\n"
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
exit (1);
|
||||
}
|
||||
else if (!strcmp (argv[i], "-v") || !strcmp (argv[i], "--version"))
|
||||
{
|
||||
std::cout << "\n"
|
||||
std::cout << '\n'
|
||||
<< format (STRING_CMD_VERSION_BUILT, "calc", VERSION)
|
||||
<< osName ()
|
||||
<< "\n"
|
||||
<< '\n'
|
||||
<< STRING_CMD_VERSION_COPY
|
||||
<< "\n"
|
||||
<< "\n"
|
||||
<< '\n'
|
||||
<< '\n'
|
||||
<< STRING_CMD_VERSION_MIT
|
||||
<< "\n"
|
||||
<< "\n";
|
||||
<< '\n'
|
||||
<< '\n';
|
||||
|
||||
exit (1);
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ int main (int argc, char** argv)
|
|||
else if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "--postfix"))
|
||||
infix = false;
|
||||
else
|
||||
expression += std::string (argv[i]) + " ";
|
||||
expression += std::string (argv[i]) + ' ';
|
||||
|
||||
Variant result;
|
||||
if (infix)
|
||||
|
@ -112,16 +112,16 @@ int main (int argc, char** argv)
|
|||
|
||||
// Show any debug output.
|
||||
for (auto& i : context.debugMessages)
|
||||
std::cout << i << "\n";
|
||||
std::cout << i << '\n';
|
||||
|
||||
// Show the result in string form.
|
||||
std::cout << (std::string) result
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
|
||||
catch (const std::string& error)
|
||||
{
|
||||
std::cerr << error << "\n";
|
||||
std::cerr << error << '\n';
|
||||
status = -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ void ColumnDescription::render (
|
|||
for (const auto& i : annos)
|
||||
{
|
||||
ISO8601d dt (strtol (i.first.substr (11).c_str (), NULL, 10));
|
||||
description += "\n" + std::string (_indent, ' ') + dt.toString (_dateformat) + " " + i.second;
|
||||
description += '\n' + std::string (_indent, ' ') + dt.toString (_dateformat) + ' ' + i.second;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ void ColumnDescription::render (
|
|||
for (const auto& i : annos)
|
||||
{
|
||||
ISO8601d dt (strtol (i.first.substr (11).c_str (), NULL, 10));
|
||||
description += " " + dt.toString (_dateformat) + " " + i.second;
|
||||
description += ' ' + dt.toString (_dateformat) + ' ' + i.second;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -63,19 +63,19 @@ int CmdAdd::execute (std::string& output)
|
|||
if (context.verbose ("new-id") &&
|
||||
(status == Task::pending ||
|
||||
status == Task::waiting))
|
||||
output += format (STRING_CMD_ADD_FEEDBACK, task.id) + "\n";
|
||||
output += format (STRING_CMD_ADD_FEEDBACK, task.id) + '\n';
|
||||
|
||||
else if (context.verbose ("new-id") &&
|
||||
status == Task::recurring)
|
||||
output += format (STRING_CMD_ADD_RECUR, task.id) + "\n";
|
||||
output += format (STRING_CMD_ADD_RECUR, task.id) + '\n';
|
||||
|
||||
else if (context.verbose ("new-uuid") &&
|
||||
status != Task::recurring)
|
||||
output += format (STRING_CMD_ADD_FEEDBACK, task.get ("uuid")) + "\n";
|
||||
output += format (STRING_CMD_ADD_FEEDBACK, task.get ("uuid")) + '\n';
|
||||
|
||||
else if (context.verbose ("new-uuid") &&
|
||||
status == Task::recurring)
|
||||
output += format (STRING_CMD_ADD_RECUR, task.get ("uuid")) + "\n";
|
||||
output += format (STRING_CMD_ADD_RECUR, task.get ("uuid")) + '\n';
|
||||
|
||||
if (context.verbose ("project"))
|
||||
context.footnote (onProjectChange (task));
|
||||
|
|
|
@ -53,7 +53,7 @@ int CmdCompletionAliases::execute (std::string& output)
|
|||
{
|
||||
for (auto& alias : context.config)
|
||||
if (alias.first.substr (0, 6) == "alias.")
|
||||
output += alias.first.substr (6) + "\n";
|
||||
output += alias.first.substr (6) + '\n';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ int CmdAnnotate::execute (std::string&)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << STRING_CMD_ANNO_NO << "\n";
|
||||
std::cout << STRING_CMD_ANNO_NO << '\n';
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
|
|
|
@ -118,7 +118,7 @@ int CmdAppend::execute (std::string&)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << STRING_CMD_APPEND_NO << "\n";
|
||||
std::cout << STRING_CMD_APPEND_NO << '\n';
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
|
|
|
@ -60,7 +60,7 @@ int CmdZshAttributes::execute (std::string& output)
|
|||
|
||||
std::stringstream out;
|
||||
for (auto& col : columns)
|
||||
out << col << ":" << col << "\n";
|
||||
out << col << ":" << col << '\n';
|
||||
|
||||
output = out.str ();
|
||||
return 0;
|
||||
|
|
|
@ -405,13 +405,13 @@ std::string Chart::render ()
|
|||
if (_graph_height < 5 || // a 4-line graph is essentially unreadable.
|
||||
_graph_width < 2) // A single-bar graph is useless.
|
||||
{
|
||||
return std::string (STRING_CMD_BURN_TOO_SMALL) + "\n";
|
||||
return std::string (STRING_CMD_BURN_TOO_SMALL) + '\n';
|
||||
}
|
||||
|
||||
else if (_graph_height > 1000 || // each line is a string allloc
|
||||
_graph_width > 1000)
|
||||
{
|
||||
return std::string (STRING_CMD_BURN_TOO_LARGE) + "\n";
|
||||
return std::string (STRING_CMD_BURN_TOO_LARGE) + '\n';
|
||||
}
|
||||
|
||||
if (_max_value == 0)
|
||||
|
@ -420,7 +420,7 @@ std::string Chart::render ()
|
|||
// Create a grid, folded into a string.
|
||||
_grid = "";
|
||||
for (int i = 0; i < _height; ++i)
|
||||
_grid += std::string (_width, ' ') + "\n";
|
||||
_grid += std::string (_width, ' ') + '\n';
|
||||
|
||||
// Title.
|
||||
std::string full_title;
|
||||
|
@ -437,7 +437,7 @@ std::string Chart::render ()
|
|||
{
|
||||
if (full_title.length () + 1 + _title.length () < (unsigned) _width)
|
||||
{
|
||||
full_title += " " + _title;
|
||||
full_title += ' ' + _title;
|
||||
_grid.replace (LOC (0, (_width - full_title.length ()) / 2), full_title.length (), full_title);
|
||||
}
|
||||
else
|
||||
|
@ -494,7 +494,7 @@ std::string Chart::render ()
|
|||
_grid.replace (LOC (_height - 5, _max_label + 3 + ((_actual_bars - bar._offset - 1) * 3)), bar._minor_label.length (), bar._minor_label);
|
||||
|
||||
if (_major_label != bar._major_label)
|
||||
_grid.replace (LOC (_height - 4, _max_label + 2 + ((_actual_bars - bar._offset - 1) * 3)), bar._major_label.length (), " " + bar._major_label);
|
||||
_grid.replace (LOC (_height - 4, _max_label + 2 + ((_actual_bars - bar._offset - 1) * 3)), bar._major_label.length (), ' ' + bar._major_label);
|
||||
|
||||
_major_label = bar._major_label;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ int CmdCalc::execute (std::string& output)
|
|||
// Compile all the args into one expression.
|
||||
std::string expression;
|
||||
for (auto& word : context.cli2.getWords ())
|
||||
expression += word + " ";
|
||||
expression += word + ' ';
|
||||
|
||||
// Evaluate according to preference.
|
||||
Variant result;
|
||||
|
@ -78,7 +78,7 @@ int CmdCalc::execute (std::string& output)
|
|||
else
|
||||
e.evaluatePostfixExpression (expression, result);
|
||||
|
||||
output = (std::string) result + "\n";
|
||||
output = (std::string) result + '\n';
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -225,7 +225,7 @@ int CmdCalendar::execute (std::string& output)
|
|||
int details_mFrom = mFrom;
|
||||
|
||||
std::stringstream out;
|
||||
out << "\n";
|
||||
out << '\n';
|
||||
|
||||
while (yFrom < yTo || (yFrom == yTo && mFrom <= mTo))
|
||||
{
|
||||
|
@ -269,10 +269,10 @@ int CmdCalendar::execute (std::string& output)
|
|||
}
|
||||
}
|
||||
|
||||
out << "\n"
|
||||
out << '\n'
|
||||
<< optionalBlankLine ()
|
||||
<< renderMonths (mFrom, yFrom, today, tasks, monthsPerLine)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
mFrom += monthsPerLine;
|
||||
if (mFrom > 12)
|
||||
|
@ -306,9 +306,9 @@ int CmdCalendar::execute (std::string& output)
|
|||
<< color_holiday.colorize ("holiday")
|
||||
<< ", "
|
||||
<< color_weeknumber.colorize ("weeknumber")
|
||||
<< "."
|
||||
<< '.'
|
||||
<< optionalBlankLine ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
if (context.config.get ("calendar.details") == "full" || context.config.get ("calendar.holidays") == "full")
|
||||
{
|
||||
|
@ -409,7 +409,7 @@ int CmdCalendar::execute (std::string& output)
|
|||
|
||||
out << optionalBlankLine ()
|
||||
<< holTable.render ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ int CmdColor::execute (std::string& output)
|
|||
// use.
|
||||
if (legend)
|
||||
{
|
||||
out << "\n" << STRING_CMD_COLOR_HERE << "\n";
|
||||
out << '\n' << STRING_CMD_COLOR_HERE << '\n';
|
||||
|
||||
ViewText view;
|
||||
view.width (context.getWidth ());
|
||||
|
@ -94,7 +94,7 @@ int CmdColor::execute (std::string& output)
|
|||
}
|
||||
|
||||
out << view.render ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
|
||||
// If there is something in the description, then assume that is a color,
|
||||
|
@ -112,26 +112,26 @@ int CmdColor::execute (std::string& output)
|
|||
for (auto word = words.begin (); word != words.end (); ++word)
|
||||
{
|
||||
if (word != words.begin ())
|
||||
swatch += " ";
|
||||
swatch += ' ';
|
||||
|
||||
swatch += *word;
|
||||
}
|
||||
|
||||
Color sample (swatch);
|
||||
|
||||
out << "\n"
|
||||
<< STRING_CMD_COLOR_EXPLANATION << "\n"
|
||||
out << '\n'
|
||||
<< STRING_CMD_COLOR_EXPLANATION << '\n'
|
||||
<< "\n\n"
|
||||
<< STRING_CMD_COLOR_16 << "\n"
|
||||
<< " " << one.colorize ("task color black on bright yellow") << "\n"
|
||||
<< " " << two.colorize ("task color underline cyan on bright blue") << "\n"
|
||||
<< "\n"
|
||||
<< STRING_CMD_COLOR_256 << "\n"
|
||||
<< " " << three.colorize ("task color color214 on color202") << "\n"
|
||||
<< " " << four.colorize ("task color rgb150 on rgb020") << "\n"
|
||||
<< " " << five.colorize ("task color underline grey10 on grey3") << "\n"
|
||||
<< " " << six.colorize ("task color red on color173") << "\n"
|
||||
<< "\n"
|
||||
<< STRING_CMD_COLOR_16 << '\n'
|
||||
<< " " << one.colorize ("task color black on bright yellow") << '\n'
|
||||
<< " " << two.colorize ("task color underline cyan on bright blue") << '\n'
|
||||
<< '\n'
|
||||
<< STRING_CMD_COLOR_256 << '\n'
|
||||
<< " " << three.colorize ("task color color214 on color202") << '\n'
|
||||
<< " " << four.colorize ("task color rgb150 on rgb020") << '\n'
|
||||
<< " " << five.colorize ("task color underline grey10 on grey3") << '\n'
|
||||
<< " " << six.colorize ("task color red on color173") << '\n'
|
||||
<< '\n'
|
||||
<< STRING_CMD_COLOR_YOURS << "\n\n"
|
||||
<< " " << sample.colorize ("task color " + swatch) << "\n\n";
|
||||
}
|
||||
|
@ -139,41 +139,41 @@ int CmdColor::execute (std::string& output)
|
|||
// Show all supported colors. Possibly show some unsupported ones too.
|
||||
else
|
||||
{
|
||||
out << "\n"
|
||||
out << '\n'
|
||||
<< STRING_CMD_COLOR_BASIC
|
||||
<< "\n"
|
||||
<< " " << Color::colorize (" black ", "black")
|
||||
<< " " << Color::colorize (" red ", "red")
|
||||
<< " " << Color::colorize (" blue ", "blue")
|
||||
<< " " << Color::colorize (" green ", "green")
|
||||
<< " " << Color::colorize (" magenta ", "magenta")
|
||||
<< " " << Color::colorize (" cyan ", "cyan")
|
||||
<< " " << Color::colorize (" yellow ", "yellow")
|
||||
<< " " << Color::colorize (" white ", "white")
|
||||
<< "\n"
|
||||
<< " " << Color::colorize (" black ", "white on black")
|
||||
<< " " << Color::colorize (" red ", "white on red")
|
||||
<< " " << Color::colorize (" blue ", "white on blue")
|
||||
<< " " << Color::colorize (" green ", "black on green")
|
||||
<< " " << Color::colorize (" magenta ", "black on magenta")
|
||||
<< " " << Color::colorize (" cyan ", "black on cyan")
|
||||
<< " " << Color::colorize (" yellow ", "black on yellow")
|
||||
<< " " << Color::colorize (" white ", "black on white")
|
||||
<< '\n'
|
||||
<< ' ' << Color::colorize (" black ", "black")
|
||||
<< ' ' << Color::colorize (" red ", "red")
|
||||
<< ' ' << Color::colorize (" blue ", "blue")
|
||||
<< ' ' << Color::colorize (" green ", "green")
|
||||
<< ' ' << Color::colorize (" magenta ", "magenta")
|
||||
<< ' ' << Color::colorize (" cyan ", "cyan")
|
||||
<< ' ' << Color::colorize (" yellow ", "yellow")
|
||||
<< ' ' << Color::colorize (" white ", "white")
|
||||
<< '\n'
|
||||
<< ' ' << Color::colorize (" black ", "white on black")
|
||||
<< ' ' << Color::colorize (" red ", "white on red")
|
||||
<< ' ' << Color::colorize (" blue ", "white on blue")
|
||||
<< ' ' << Color::colorize (" green ", "black on green")
|
||||
<< ' ' << Color::colorize (" magenta ", "black on magenta")
|
||||
<< ' ' << Color::colorize (" cyan ", "black on cyan")
|
||||
<< ' ' << Color::colorize (" yellow ", "black on yellow")
|
||||
<< ' ' << Color::colorize (" white ", "black on white")
|
||||
<< "\n\n";
|
||||
|
||||
out << STRING_CMD_COLOR_EFFECTS
|
||||
<< "\n"
|
||||
<< " " << Color::colorize (" red ", "red")
|
||||
<< " " << Color::colorize (" bold red ", "bold red")
|
||||
<< " " << Color::colorize (" underline on blue ", "underline on blue")
|
||||
<< " " << Color::colorize (" on green ", "black on green")
|
||||
<< " " << Color::colorize (" on bright green ", "black on bright green")
|
||||
<< " " << Color::colorize (" inverse ", "inverse")
|
||||
<< '\n'
|
||||
<< ' ' << Color::colorize (" red ", "red")
|
||||
<< ' ' << Color::colorize (" bold red ", "bold red")
|
||||
<< ' ' << Color::colorize (" underline on blue ", "underline on blue")
|
||||
<< ' ' << Color::colorize (" on green ", "black on green")
|
||||
<< ' ' << Color::colorize (" on bright green ", "black on bright green")
|
||||
<< ' ' << Color::colorize (" inverse ", "inverse")
|
||||
<< "\n\n";
|
||||
|
||||
// 16 system colors.
|
||||
out << "color0 - color15"
|
||||
<< "\n"
|
||||
<< '\n'
|
||||
<< " 0 1 2 . . .\n";
|
||||
for (int r = 0; r < 2; ++r)
|
||||
{
|
||||
|
@ -185,7 +185,7 @@ int CmdColor::execute (std::string& output)
|
|||
out << Color::colorize (" ", s.str ());
|
||||
}
|
||||
|
||||
out << "\n";
|
||||
out << '\n';
|
||||
}
|
||||
|
||||
out << " . . . 15\n\n";
|
||||
|
@ -200,21 +200,21 @@ int CmdColor::execute (std::string& output)
|
|||
<< Color::colorize ("5", "bold green")
|
||||
<< Color::colorize ("5", "bold blue")
|
||||
<< " (also color16 - color231)"
|
||||
<< "\n"
|
||||
<< '\n'
|
||||
<< " " << Color::colorize ("0 "
|
||||
"1 "
|
||||
"2 "
|
||||
"3 "
|
||||
"4 "
|
||||
"5", "bold red")
|
||||
<< "\n"
|
||||
<< '\n'
|
||||
<< " " << Color::colorize ("0 1 2 3 4 5 "
|
||||
"0 1 2 3 4 5 "
|
||||
"0 1 2 3 4 5 "
|
||||
"0 1 2 3 4 5 "
|
||||
"0 1 2 3 4 5 "
|
||||
"0 1 2 3 4 5", "bold blue")
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
char label [12];
|
||||
for (int g = 0; g < 6; ++g)
|
||||
|
@ -230,13 +230,13 @@ int CmdColor::execute (std::string& output)
|
|||
out << Color::colorize (" ", s.str ());
|
||||
}
|
||||
|
||||
out << " ";
|
||||
out << ' ';
|
||||
}
|
||||
|
||||
out << "\n";
|
||||
out << '\n';
|
||||
}
|
||||
|
||||
out << "\n";
|
||||
out << '\n';
|
||||
|
||||
// Grey ramp.
|
||||
out << STRING_CMD_COLOR_RAMP
|
||||
|
@ -257,7 +257,7 @@ int CmdColor::execute (std::string& output)
|
|||
}
|
||||
else
|
||||
{
|
||||
out << STRING_CMD_COLOR_OFF << "\n";
|
||||
out << STRING_CMD_COLOR_OFF << '\n';
|
||||
rc = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -119,9 +119,9 @@ int CmdColumns::execute (std::string& output)
|
|||
|
||||
output = optionalBlankLine ()
|
||||
+ formats.render ()
|
||||
+ "\n"
|
||||
+ '\n'
|
||||
+ STRING_CMD_COLUMNS_NOTE
|
||||
+ "\n";
|
||||
+ '\n';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ int CmdCompletionColumns::execute (std::string& output)
|
|||
|
||||
// Render only the column names.
|
||||
for (auto& name : names)
|
||||
output += name + "\n";
|
||||
output += name + '\n';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ int CmdCommands::execute (std::string& output)
|
|||
output = optionalBlankLine ()
|
||||
+ view.render ()
|
||||
+ optionalBlankLine ()
|
||||
+ "\n";
|
||||
+ '\n';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ int CmdCompletionCommands::execute (std::string& output)
|
|||
|
||||
std::stringstream out;
|
||||
for (auto& c : commands)
|
||||
out << c << "\n";
|
||||
out << c << '\n';
|
||||
|
||||
output = out.str ();
|
||||
return 0;
|
||||
|
@ -226,7 +226,7 @@ int CmdZshCommands::execute (std::string& output)
|
|||
for (auto& zc : commands)
|
||||
out << zc._command << ":"
|
||||
<< Command::categoryNames.at (zc._category) << ":"
|
||||
<< zc._description << "\n";
|
||||
<< zc._description << '\n';
|
||||
|
||||
output = out.str ();
|
||||
return 0;
|
||||
|
|
|
@ -77,7 +77,7 @@ bool CmdConfig::setConfigVariable (std::string name, std::string value, bool con
|
|||
confirm (format (STRING_CMD_CONFIG_CONFIRM, name, context.config.get (name), value)))
|
||||
{
|
||||
if (comment != std::string::npos)
|
||||
line = name + "=" + json::encode (value) + " " + line.substr (comment);
|
||||
line = name + "=" + json::encode (value) + ' ' + line.substr (comment);
|
||||
else
|
||||
line = name + "=" + json::encode (value);
|
||||
|
||||
|
@ -178,7 +178,7 @@ int CmdConfig::execute (std::string& output)
|
|||
for (unsigned int i = 1; i < words.size (); ++i)
|
||||
{
|
||||
if (i > 1)
|
||||
value += " ";
|
||||
value += ' ';
|
||||
|
||||
value += words[i];
|
||||
}
|
||||
|
@ -214,10 +214,10 @@ int CmdConfig::execute (std::string& output)
|
|||
{
|
||||
out << format (STRING_CMD_CONFIG_FILE_MOD,
|
||||
context.config._original_file._data)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
else
|
||||
out << STRING_CMD_CONFIG_NO_CHANGE << "\n";
|
||||
out << STRING_CMD_CONFIG_NO_CHANGE << '\n';
|
||||
}
|
||||
else
|
||||
throw std::string (STRING_CMD_CONFIG_NO_NAME);
|
||||
|
@ -254,7 +254,7 @@ int CmdCompletionConfig::execute (std::string& output)
|
|||
std::sort (configs.begin (), configs.end ());
|
||||
|
||||
for (auto& config : configs)
|
||||
output += config + "\n";
|
||||
output += config + '\n';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ std::string CmdContext::joinWords (const std::vector <std::string>& words, unsig
|
|||
for (unsigned int i = from; i < to; ++i)
|
||||
{
|
||||
if (i > from)
|
||||
value += " ";
|
||||
value += ' ';
|
||||
|
||||
value += words[i];
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ void CmdContext::defineContext (const std::vector <std::string>& words, std::str
|
|||
if (!success)
|
||||
throw format (STRING_CMD_CONTEXT_DEF_FAIL, words[1]);
|
||||
|
||||
out << format (STRING_CMD_CONTEXT_DEF_SUCC, words[1]) << "\n";
|
||||
out << format (STRING_CMD_CONTEXT_DEF_SUCC, words[1]) << '\n';
|
||||
}
|
||||
else
|
||||
throw std::string (STRING_CMD_CONTEXT_DEF_USAG);
|
||||
|
@ -197,7 +197,7 @@ void CmdContext::deleteContext (const std::vector <std::string>& words, std::str
|
|||
if (rc != 0)
|
||||
throw format (STRING_CMD_CONTEXT_DEL_FAIL, words[1]);
|
||||
|
||||
out << format (STRING_CMD_CONTEXT_DEL_SUCC, words[1]) << "\n";
|
||||
out << format (STRING_CMD_CONTEXT_DEL_SUCC, words[1]) << '\n';
|
||||
}
|
||||
else
|
||||
throw std::string(STRING_CMD_CONTEXT_DEL_USAG);
|
||||
|
@ -279,7 +279,7 @@ void CmdContext::setContext (const std::vector <std::string>& words, std::string
|
|||
if (! success)
|
||||
throw format (STRING_CMD_CONTEXT_SET_FAIL, value);
|
||||
|
||||
out << format (STRING_CMD_CONTEXT_SET_SUCC, value) << "\n";
|
||||
out << format (STRING_CMD_CONTEXT_SET_SUCC, value) << '\n';
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -295,11 +295,11 @@ void CmdContext::showContext (std::stringstream& out)
|
|||
auto currentContext = context.config.get ("context");
|
||||
|
||||
if (currentContext == "")
|
||||
out << STRING_CMD_CONTEXT_SHOW_EMPT << "\n";
|
||||
out << STRING_CMD_CONTEXT_SHOW_EMPT << '\n';
|
||||
else
|
||||
{
|
||||
std::string currentFilter = context.config.get ("context." + currentContext);
|
||||
out << format (STRING_CMD_CONTEXT_SHOW, currentContext, currentFilter) << "\n";
|
||||
out << format (STRING_CMD_CONTEXT_SHOW, currentContext, currentFilter) << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -318,7 +318,7 @@ void CmdContext::unsetContext (std::stringstream& out)
|
|||
if (CmdConfig::unsetConfigVariable ("context", false))
|
||||
throw std::string(STRING_CMD_CONTEXT_NON_FAIL);
|
||||
|
||||
out << STRING_CMD_CONTEXT_NON_SUCC << "\n";
|
||||
out << STRING_CMD_CONTEXT_NON_SUCC << '\n';
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -341,7 +341,7 @@ CmdCompletionContext::CmdCompletionContext ()
|
|||
int CmdCompletionContext::execute (std::string& output)
|
||||
{
|
||||
for (auto& contet : CmdContext::getContexts ())
|
||||
output += contet + "\n";
|
||||
output += contet + '\n';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ int CmdCount::execute (std::string& output)
|
|||
if (task.getStatus () != Task::recurring)
|
||||
++count;
|
||||
|
||||
output = format (count) + "\n";
|
||||
output = format (count) + '\n';
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -225,7 +225,7 @@ int CmdCustom::execute (std::string& output)
|
|||
out << ", "
|
||||
<< format (STRING_CMD_CUSTOM_TRUNCATED, maxlines - table_header);
|
||||
|
||||
out << "\n";
|
||||
out << '\n';
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -159,7 +159,7 @@ int CmdDelete::execute (std::string&)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << STRING_CMD_DELETE_NO << "\n";
|
||||
std::cout << STRING_CMD_DELETE_NO << '\n';
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
|
@ -170,7 +170,7 @@ int CmdDelete::execute (std::string&)
|
|||
std::cout << format (STRING_CMD_DELETE_NOT_DEL,
|
||||
task.identifier (true),
|
||||
task.get ("description"))
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ int CmdDenotate::execute (std::string&)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << STRING_CMD_DENO_NO << "\n";
|
||||
std::cout << STRING_CMD_DENO_NO << '\n';
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
|
@ -148,7 +148,7 @@ int CmdDenotate::execute (std::string&)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << format (STRING_CMD_DENO_NOMATCH, pattern) << "\n";
|
||||
std::cout << format (STRING_CMD_DENO_NOMATCH, pattern) << '\n';
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,19 +75,19 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
bold = Color ("bold");
|
||||
|
||||
std::stringstream out;
|
||||
out << "\n"
|
||||
out << '\n'
|
||||
<< bold.colorize (PACKAGE_STRING)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
out << " " << STRING_CMD_DIAG_PLATFORM << ": " << osName ()
|
||||
<< "\n\n";
|
||||
|
||||
// Compiler.
|
||||
out << bold.colorize (STRING_CMD_DIAG_COMPILER)
|
||||
<< "\n"
|
||||
<< '\n'
|
||||
#ifdef __VERSION__
|
||||
<< " " << STRING_CMD_DIAG_VERSION << ": "
|
||||
<< __VERSION__ << "\n"
|
||||
<< __VERSION__ << '\n'
|
||||
#endif
|
||||
<< " " << STRING_CMD_DIAG_CAPS << ":"
|
||||
#ifdef __STDC__
|
||||
|
@ -116,7 +116,7 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
<< " +l" << 8 * sizeof (long)
|
||||
<< " +vp" << 8 * sizeof (void*)
|
||||
<< " +time_t" << 8 * sizeof (time_t)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
// Compiler compliance level.
|
||||
std::string compliance = "non-compliant";
|
||||
|
@ -129,20 +129,20 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
else
|
||||
compliance = format (level);
|
||||
#endif
|
||||
out << " " << STRING_CMD_DIAG_COMPLIANCE
|
||||
out << ' ' << STRING_CMD_DIAG_COMPLIANCE
|
||||
<< ": "
|
||||
<< compliance
|
||||
<< "\n\n";
|
||||
|
||||
out << bold.colorize (STRING_CMD_DIAG_FEATURES)
|
||||
<< "\n"
|
||||
<< '\n'
|
||||
|
||||
// Build date.
|
||||
<< " " << STRING_CMD_DIAG_BUILT << ": " << __DATE__ << " " << __TIME__ << "\n"
|
||||
<< " " << STRING_CMD_DIAG_BUILT << ": " << __DATE__ << ' ' << __TIME__ << '\n'
|
||||
#ifdef HAVE_COMMIT
|
||||
<< " " << STRING_CMD_DIAG_COMMIT << ": " << COMMIT << "\n"
|
||||
<< " " << STRING_CMD_DIAG_COMMIT << ": " << COMMIT << '\n'
|
||||
#endif
|
||||
<< " CMake: " << CMAKE_VERSION << "\n";
|
||||
<< " CMake: " << CMAKE_VERSION << '\n';
|
||||
|
||||
out << " libuuid: "
|
||||
#ifdef HAVE_UUID_UNPARSE_LOWER
|
||||
|
@ -150,7 +150,7 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
#else
|
||||
<< "libuuid, no uuid_unparse_lower"
|
||||
#endif
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
out << " libgnutls: "
|
||||
#ifdef HAVE_LIBGNUTLS
|
||||
|
@ -162,7 +162,7 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
#else
|
||||
<< "n/a"
|
||||
#endif
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
out << " Build type: "
|
||||
#ifdef CMAKE_BUILD_TYPE
|
||||
|
@ -174,20 +174,20 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
|
||||
// Config: .taskrc found, readable, writable
|
||||
out << bold.colorize (STRING_CMD_DIAG_CONFIG)
|
||||
<< "\n"
|
||||
<< " File: " << context.config._original_file._data << " "
|
||||
<< '\n'
|
||||
<< " File: " << context.config._original_file._data << ' '
|
||||
<< (context.config._original_file.exists ()
|
||||
? STRING_CMD_DIAG_FOUND
|
||||
: STRING_CMD_DIAG_MISSING)
|
||||
<< ", " << context.config._original_file.size () << " " << "bytes"
|
||||
<< ", " << context.config._original_file.size () << ' ' << "bytes"
|
||||
<< ", mode "
|
||||
<< std::setbase (8)
|
||||
<< context.config._original_file.mode ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
// Config: data.location found, readable, writable
|
||||
File location (context.config.get ("data.location"));
|
||||
out << " Data: " << location._data << " "
|
||||
out << " Data: " << location._data << ' '
|
||||
<< (location.exists ()
|
||||
? STRING_CMD_DIAG_FOUND
|
||||
: STRING_CMD_DIAG_MISSING)
|
||||
|
@ -195,44 +195,44 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
<< ", mode "
|
||||
<< std::setbase (8)
|
||||
<< location.mode ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
char* env = getenv ("TASKRC");
|
||||
if (env)
|
||||
out << " TASKRC: "
|
||||
<< env
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
env = getenv ("TASKDATA");
|
||||
if (env)
|
||||
out << " TASKDATA: "
|
||||
<< env
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
out << " Locking: "
|
||||
<< (context.config.getBoolean ("locking")
|
||||
? STRING_CMD_DIAG_ENABLED
|
||||
: STRING_CMD_DIAG_DISABLED)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
out << " GC: "
|
||||
<< (context.config.getBoolean ("gc")
|
||||
? STRING_CMD_DIAG_ENABLED
|
||||
: STRING_CMD_DIAG_DISABLED)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
// Determine rc.editor/$EDITOR/$VISUAL.
|
||||
char* peditor;
|
||||
if (context.config.get ("editor") != "")
|
||||
out << " rc.editor: " << context.config.get ("editor") << "\n";
|
||||
out << " rc.editor: " << context.config.get ("editor") << '\n';
|
||||
else if ((peditor = getenv ("VISUAL")) != NULL)
|
||||
out << " $VISUAL: " << peditor << "\n";
|
||||
out << " $VISUAL: " << peditor << '\n';
|
||||
else if ((peditor = getenv ("EDITOR")) != NULL)
|
||||
out << " $EDITOR: " << peditor << "\n";
|
||||
out << " $EDITOR: " << peditor << '\n';
|
||||
|
||||
out << " Server: "
|
||||
<< context.config.get ("taskd.server")
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
if (context.config.get ("taskd.ca") != "")
|
||||
out << " CA: "
|
||||
|
@ -246,7 +246,7 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
if (trust_value == "strict" ||
|
||||
trust_value == "ignore hostname" ||
|
||||
trust_value == "allow all")
|
||||
out << " Trust: " << trust_value << "\n";
|
||||
out << " Trust: " << trust_value << '\n';
|
||||
else
|
||||
out << " Trust: Bad value - see 'man taskrc'\n";
|
||||
|
||||
|
@ -266,7 +266,7 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
|
||||
out << " Ciphers: "
|
||||
<< context.config.get ("taskd.ciphers")
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
// Get credentials, but mask out the key.
|
||||
std::string credentials = context.config.get ("taskd.credentials");
|
||||
|
@ -285,13 +285,13 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
hookLocation += "hooks";
|
||||
|
||||
out << bold.colorize (STRING_CMD_DIAG_HOOKS)
|
||||
<< "\n"
|
||||
<< '\n'
|
||||
<< " System: "
|
||||
<< (context.config.getBoolean ("hooks") ? STRING_CMD_DIAG_HOOK_ENABLE : STRING_CMD_DIAG_HOOK_DISABLE)
|
||||
<< "\n"
|
||||
<< '\n'
|
||||
<< " Location: "
|
||||
<< static_cast <std::string> (hookLocation)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
auto hooks = context.hooks.list ();
|
||||
if (hooks.size ())
|
||||
|
@ -323,13 +323,13 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
out << std::left << name
|
||||
<< format (" ({1})", STRING_CMD_DIAG_HOOK_EXEC)
|
||||
<< (p.is_link () ? format (" ({1})", STRING_CMD_DIAG_HOOK_SYMLINK) : "")
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! count)
|
||||
out << "\n";
|
||||
out << '\n';
|
||||
|
||||
out << " Inactive: ";
|
||||
count = 0;
|
||||
|
@ -356,22 +356,22 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
name.substr (0, 9) == "on-modify" ||
|
||||
name.substr (0, 9) == "on-launch" ||
|
||||
name.substr (0, 7) == "on-exit") ? "" : format (" ({1})", STRING_CMD_DIAG_HOOK_NAME))
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! count)
|
||||
out << "\n";
|
||||
out << '\n';
|
||||
}
|
||||
else
|
||||
out << format (" ({1})\n", STRING_CMD_DIAG_NONE);
|
||||
|
||||
out << "\n";
|
||||
out << '\n';
|
||||
|
||||
// Verify UUIDs are all unique.
|
||||
out << bold.colorize (STRING_CMD_DIAG_TESTS)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
// Determine terminal details.
|
||||
const char* term = getenv ("TERM");
|
||||
|
@ -399,17 +399,17 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
|
||||
out << " Dups: "
|
||||
<< format (STRING_CMD_DIAG_UUID_SCAN, all.size ())
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
if (dups.size ())
|
||||
{
|
||||
for (auto& d : dups)
|
||||
out << " " << format (STRING_CMD_DIAG_UUID_DUP, d) << "\n";
|
||||
out << " " << format (STRING_CMD_DIAG_UUID_DUP, d) << '\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
out << " " << STRING_CMD_DIAG_UUID_NO_DUP
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
|
||||
|
||||
|
@ -418,7 +418,7 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
bool noBrokenRefs = true;
|
||||
out << " Broken ref: "
|
||||
<< format (STRING_CMD_DIAG_REF_SCAN, all.size ())
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
for (auto& task : all)
|
||||
{
|
||||
|
@ -432,7 +432,7 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
{
|
||||
out << " "
|
||||
<< format (STRING_CMD_DIAG_MISS_DEP, task.get ("uuid"), uuid)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
noBrokenRefs = false;
|
||||
}
|
||||
}
|
||||
|
@ -444,16 +444,16 @@ int CmdDiagnostics::execute (std::string& output)
|
|||
{
|
||||
out << " "
|
||||
<< format (STRING_CMD_DIAG_MISS_PAR, task.get ("uuid"), parentUUID)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
noBrokenRefs = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (noBrokenRefs)
|
||||
out << " " << STRING_CMD_DIAG_REF_OK
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
out << "\n";
|
||||
out << '\n';
|
||||
output = out.str ();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ int CmdDone::execute (std::string&)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << STRING_CMD_DONE_NO << "\n";
|
||||
std::cout << STRING_CMD_DONE_NO << '\n';
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
|
@ -123,7 +123,7 @@ int CmdDone::execute (std::string&)
|
|||
std::cout << format (STRING_CMD_DONE_NOTPEND,
|
||||
task.identifier (true),
|
||||
task.get ("description"))
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ int CmdDuplicate::execute (std::string&)
|
|||
dup.remove ("until");
|
||||
dup.remove ("imask");
|
||||
std::cout << format (STRING_CMD_DUPLICATE_NON_REC, task.identifier ())
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
|
||||
// When duplicating a parent task, create a new parent task.
|
||||
|
@ -97,7 +97,7 @@ int CmdDuplicate::execute (std::string&)
|
|||
{
|
||||
dup.remove ("mask");
|
||||
std::cout << format (STRING_CMD_DUPLICATE_REC, task.identifier ())
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
|
||||
dup.setStatus (Task::pending); // Does not inherit status.
|
||||
|
@ -118,18 +118,18 @@ int CmdDuplicate::execute (std::string&)
|
|||
if (context.verbose ("new-id") &&
|
||||
(status == Task::pending ||
|
||||
status == Task::waiting))
|
||||
std::cout << format (STRING_CMD_ADD_FEEDBACK, dup.id) + "\n";
|
||||
std::cout << format (STRING_CMD_ADD_FEEDBACK, dup.id) + '\n';
|
||||
|
||||
else if (context.verbose ("new-uuid") &&
|
||||
status != Task::recurring)
|
||||
std::cout << format (STRING_CMD_ADD_FEEDBACK, dup.get ("uuid")) + "\n";
|
||||
std::cout << format (STRING_CMD_ADD_FEEDBACK, dup.get ("uuid")) + '\n';
|
||||
|
||||
if (context.verbose ("project"))
|
||||
projectChanges[task.get ("project")] = onProjectChange (task);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << STRING_CMD_DUPLICATE_NO << "\n";
|
||||
std::cout << STRING_CMD_DUPLICATE_NO << '\n';
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
|
|
|
@ -102,7 +102,7 @@ std::string CmdEdit::findValue (
|
|||
auto found = text.find (name);
|
||||
if (found != std::string::npos)
|
||||
{
|
||||
auto eol = text.find ("\n", found + 1);
|
||||
auto eol = text.find ('\n', found + 1);
|
||||
if (eol != std::string::npos)
|
||||
{
|
||||
std::string value = text.substr (
|
||||
|
@ -149,7 +149,7 @@ std::vector <std::string> CmdEdit::findValues (
|
|||
found = text.find (name, found + 1);
|
||||
if (found != std::string::npos)
|
||||
{
|
||||
auto eol = text.find ("\n", found + 1);
|
||||
auto eol = text.find ('\n', found + 1);
|
||||
if (eol != std::string::npos)
|
||||
{
|
||||
std::string value = text.substr (
|
||||
|
@ -203,30 +203,30 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
|||
bool verbose = context.verbose ("edit");
|
||||
|
||||
if (verbose)
|
||||
before << "# " << STRING_EDIT_HEADER_1 << "\n"
|
||||
<< "# " << STRING_EDIT_HEADER_2 << "\n"
|
||||
<< "# " << STRING_EDIT_HEADER_3 << "\n"
|
||||
<< "# " << STRING_EDIT_HEADER_4 << "\n"
|
||||
<< "# " << STRING_EDIT_HEADER_5 << "\n"
|
||||
<< "# " << STRING_EDIT_HEADER_6 << "\n"
|
||||
before << "# " << STRING_EDIT_HEADER_1 << '\n'
|
||||
<< "# " << STRING_EDIT_HEADER_2 << '\n'
|
||||
<< "# " << STRING_EDIT_HEADER_3 << '\n'
|
||||
<< "# " << STRING_EDIT_HEADER_4 << '\n'
|
||||
<< "# " << STRING_EDIT_HEADER_5 << '\n'
|
||||
<< "# " << STRING_EDIT_HEADER_6 << '\n'
|
||||
<< "#\n"
|
||||
<< "# " << STRING_EDIT_HEADER_7 << "\n"
|
||||
<< "# " << STRING_EDIT_HEADER_8 << "\n"
|
||||
<< "# " << STRING_EDIT_HEADER_9 << "\n"
|
||||
<< "# " << STRING_EDIT_HEADER_7 << '\n'
|
||||
<< "# " << STRING_EDIT_HEADER_8 << '\n'
|
||||
<< "# " << STRING_EDIT_HEADER_9 << '\n'
|
||||
<< "#\n"
|
||||
<< "# " << STRING_EDIT_HEADER_10 << "\n"
|
||||
<< "# " << STRING_EDIT_HEADER_11 << "\n"
|
||||
<< "# " << STRING_EDIT_HEADER_12 << "\n"
|
||||
<< "# " << STRING_EDIT_HEADER_10 << '\n'
|
||||
<< "# " << STRING_EDIT_HEADER_11 << '\n'
|
||||
<< "# " << STRING_EDIT_HEADER_12 << '\n'
|
||||
<< "#\n";
|
||||
|
||||
before << "# " << STRING_EDIT_TABLE_HEADER_1 << "\n"
|
||||
<< "# " << STRING_EDIT_TABLE_HEADER_2 << "\n"
|
||||
<< "# ID: " << task.id << "\n"
|
||||
<< "# UUID: " << task.get ("uuid") << "\n"
|
||||
<< "# Status: " << Lexer::ucFirst (Task::statusToText (task.getStatus ())) << "\n"
|
||||
<< "# Mask: " << task.get ("mask") << "\n"
|
||||
<< "# iMask: " << task.get ("imask") << "\n"
|
||||
<< " Project: " << task.get ("project") << "\n";
|
||||
before << "# " << STRING_EDIT_TABLE_HEADER_1 << '\n'
|
||||
<< "# " << STRING_EDIT_TABLE_HEADER_2 << '\n'
|
||||
<< "# ID: " << task.id << '\n'
|
||||
<< "# UUID: " << task.get ("uuid") << '\n'
|
||||
<< "# Status: " << Lexer::ucFirst (Task::statusToText (task.getStatus ())) << '\n'
|
||||
<< "# Mask: " << task.get ("mask") << '\n'
|
||||
<< "# iMask: " << task.get ("imask") << '\n'
|
||||
<< " Project: " << task.get ("project") << '\n';
|
||||
|
||||
std::vector <std::string> tags;
|
||||
task.getTags (tags);
|
||||
|
@ -234,25 +234,25 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
|||
join (allTags, " ", tags);
|
||||
|
||||
if (verbose)
|
||||
before << "# " << STRING_EDIT_TAG_SEP << "\n";
|
||||
before << "# " << STRING_EDIT_TAG_SEP << '\n';
|
||||
|
||||
before << " Tags: " << allTags << "\n"
|
||||
<< " Description: " << task.get ("description") << "\n"
|
||||
<< " Created: " << formatDate (task, "entry", dateformat) << "\n"
|
||||
<< " Started: " << formatDate (task, "start", dateformat) << "\n"
|
||||
<< " Ended: " << formatDate (task, "end", dateformat) << "\n"
|
||||
<< " Scheduled: " << formatDate (task, "scheduled", dateformat) << "\n"
|
||||
<< " Due: " << formatDate (task, "due", dateformat) << "\n"
|
||||
<< " Until: " << formatDate (task, "until", dateformat) << "\n"
|
||||
<< " Recur: " << task.get ("recur") << "\n"
|
||||
<< " Wait until: " << formatDate (task, "wait", dateformat) << "\n"
|
||||
<< "# Modified: " << formatDate (task, "modified", dateformat) << "\n"
|
||||
<< " Parent: " << task.get ("parent") << "\n";
|
||||
before << " Tags: " << allTags << '\n'
|
||||
<< " Description: " << task.get ("description") << '\n'
|
||||
<< " Created: " << formatDate (task, "entry", dateformat) << '\n'
|
||||
<< " Started: " << formatDate (task, "start", dateformat) << '\n'
|
||||
<< " Ended: " << formatDate (task, "end", dateformat) << '\n'
|
||||
<< " Scheduled: " << formatDate (task, "scheduled", dateformat) << '\n'
|
||||
<< " Due: " << formatDate (task, "due", dateformat) << '\n'
|
||||
<< " Until: " << formatDate (task, "until", dateformat) << '\n'
|
||||
<< " Recur: " << task.get ("recur") << '\n'
|
||||
<< " Wait until: " << formatDate (task, "wait", dateformat) << '\n'
|
||||
<< "# Modified: " << formatDate (task, "modified", dateformat) << '\n'
|
||||
<< " Parent: " << task.get ("parent") << '\n';
|
||||
|
||||
if (verbose)
|
||||
before << "# " << STRING_EDIT_HEADER_13 << "\n"
|
||||
<< "# " << STRING_EDIT_HEADER_14 << "\n"
|
||||
<< "# " << STRING_EDIT_HEADER_15 << "\n";
|
||||
before << "# " << STRING_EDIT_HEADER_13 << '\n'
|
||||
<< "# " << STRING_EDIT_HEADER_14 << '\n'
|
||||
<< "# " << STRING_EDIT_HEADER_15 << '\n';
|
||||
|
||||
std::map <std::string, std::string> annotations;
|
||||
task.getAnnotations (annotations);
|
||||
|
@ -260,7 +260,7 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
|||
{
|
||||
ISO8601d dt (strtol (anno.first.substr (11).c_str (), NULL, 10));
|
||||
before << " Annotation: " << dt.toString (dateformat)
|
||||
<< " -- " << json::encode (anno.second) << "\n";
|
||||
<< " -- " << json::encode (anno.second) << '\n';
|
||||
}
|
||||
|
||||
ISO8601d now;
|
||||
|
@ -285,9 +285,9 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
|||
}
|
||||
|
||||
if (verbose)
|
||||
before << "# " << STRING_EDIT_DEP_SEP << "\n";
|
||||
before << "# " << STRING_EDIT_DEP_SEP << '\n';
|
||||
|
||||
before << " Dependencies: " << allDeps.str () << "\n";
|
||||
before << " Dependencies: " << allDeps.str () << '\n';
|
||||
|
||||
// UDAs
|
||||
std::vector <std::string> udas;
|
||||
|
@ -297,7 +297,7 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
|||
|
||||
if (udas.size ())
|
||||
{
|
||||
before << "# " << STRING_EDIT_UDA_SEP << "\n";
|
||||
before << "# " << STRING_EDIT_UDA_SEP << '\n';
|
||||
std::sort (udas.begin (), udas.end ());
|
||||
for (auto& uda : udas)
|
||||
{
|
||||
|
@ -307,12 +307,12 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
|||
padding = std::string (pad, ' ');
|
||||
|
||||
std::string type = context.config.get ("uda." + uda + ".type");
|
||||
if (type == "string" || type == "numeric")
|
||||
before << " UDA " << uda << ": " << padding << task.get (uda) << "\n";
|
||||
if (type == "string" || type == "numeric")
|
||||
before << " UDA " << uda << ": " << padding << task.get (uda) << '\n';
|
||||
else if (type == "date")
|
||||
before << " UDA " << uda << ": " << padding << formatDate (task, uda, dateformat) << "\n";
|
||||
before << " UDA " << uda << ": " << padding << formatDate (task, uda, dateformat) << '\n';
|
||||
else if (type == "duration")
|
||||
before << " UDA " << uda << ": " << padding << formatDuration (task, uda) << "\n";
|
||||
before << " UDA " << uda << ": " << padding << formatDuration (task, uda) << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -322,7 +322,7 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
|||
|
||||
if (orphans.size ())
|
||||
{
|
||||
before << "# " << STRING_EDIT_UDA_ORPHAN_SEP << "\n";
|
||||
before << "# " << STRING_EDIT_UDA_ORPHAN_SEP << '\n';
|
||||
std::sort (orphans.begin (), orphans.end ());
|
||||
for (auto& orphan : orphans)
|
||||
{
|
||||
|
@ -331,11 +331,11 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
|
|||
if (pad > 0)
|
||||
padding = std::string (pad, ' ');
|
||||
|
||||
before << " UDA Orphan " << orphan << ": " << padding << task.get (orphan) << "\n";
|
||||
before << " UDA Orphan " << orphan << ": " << padding << task.get (orphan) << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
before << "# " << STRING_EDIT_END << "\n";
|
||||
before << "# " << STRING_EDIT_END << '\n';
|
||||
return before.str ();
|
||||
}
|
||||
|
||||
|
@ -633,7 +633,7 @@ void CmdEdit::parseTask (Task& task, const std::string& after, const std::string
|
|||
{
|
||||
found += 14; // Length of "\n Annotation:".
|
||||
|
||||
auto eol = after.find ("\n", found + 1);
|
||||
auto eol = after.find ('\n', found + 1);
|
||||
if (eol != std::string::npos)
|
||||
{
|
||||
std::string value = Lexer::trim (after.substr (
|
||||
|
@ -797,22 +797,22 @@ CmdEdit::editResult CmdEdit::editFile (Task& task)
|
|||
if (editor == "") editor = "vi";
|
||||
|
||||
// Complete the command line.
|
||||
editor += " ";
|
||||
editor += ' ';
|
||||
editor += "\"" + file.str () + "\"";
|
||||
|
||||
ARE_THESE_REALLY_HARMFUL:
|
||||
bool changes = false; // No changes made.
|
||||
|
||||
// Launch the editor.
|
||||
std::cout << format (STRING_EDIT_LAUNCHING, editor) << "\n";
|
||||
std::cout << format (STRING_EDIT_LAUNCHING, editor) << '\n';
|
||||
int exitcode = system (editor.c_str ());
|
||||
if (0 == exitcode)
|
||||
std::cout << STRING_EDIT_COMPLETE << "\n";
|
||||
std::cout << STRING_EDIT_COMPLETE << '\n';
|
||||
else
|
||||
{
|
||||
std::cout << format (STRING_EDIT_FAILED, exitcode) << "\n";
|
||||
std::cout << format (STRING_EDIT_FAILED, exitcode) << '\n';
|
||||
if (-1 == exitcode)
|
||||
std::cout << std::strerror (errno) << "\n";
|
||||
std::cout << std::strerror (errno) << '\n';
|
||||
return CmdEdit::editResult::error;
|
||||
}
|
||||
|
||||
|
@ -824,7 +824,7 @@ ARE_THESE_REALLY_HARMFUL:
|
|||
// if changes were made.
|
||||
if (before_orig != after)
|
||||
{
|
||||
std::cout << STRING_EDIT_CHANGES << "\n";
|
||||
std::cout << STRING_EDIT_CHANGES << '\n';
|
||||
std::string problem = "";
|
||||
bool oops = false;
|
||||
|
||||
|
@ -841,7 +841,7 @@ ARE_THESE_REALLY_HARMFUL:
|
|||
|
||||
if (oops)
|
||||
{
|
||||
std::cerr << STRING_ERROR_PREFIX << problem << "\n";
|
||||
std::cerr << STRING_ERROR_PREFIX << problem << '\n';
|
||||
|
||||
// Preserve the edits.
|
||||
before = after;
|
||||
|
@ -855,7 +855,7 @@ ARE_THESE_REALLY_HARMFUL:
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << STRING_EDIT_NO_CHANGES << "\n";
|
||||
std::cout << STRING_EDIT_NO_CHANGES << '\n';
|
||||
changes = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ int CmdExport::execute (std::string& output)
|
|||
{
|
||||
if (json_array)
|
||||
output += ",";
|
||||
output += "\n";
|
||||
output += '\n';
|
||||
}
|
||||
|
||||
output += task.composeJSON (true);
|
||||
|
@ -96,7 +96,7 @@ int CmdExport::execute (std::string& output)
|
|||
}
|
||||
|
||||
if (filtered.size ())
|
||||
output += "\n";
|
||||
output += '\n';
|
||||
|
||||
if (json_array)
|
||||
output += "]\n";
|
||||
|
|
|
@ -91,7 +91,7 @@ int CmdGet::execute (std::string& output)
|
|||
throw std::string (STRING_CMD_GET_NO_DOM);
|
||||
|
||||
join (output, " ", results);
|
||||
output += "\n";
|
||||
output += '\n';
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include <i18n.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <iostream> // TODO Remove
|
||||
|
||||
extern Context context;
|
||||
|
||||
|
@ -57,13 +56,13 @@ int CmdHelp::execute (std::string& output)
|
|||
{
|
||||
auto words = context.cli2.getWords ();
|
||||
if (words.size () == 1 && closeEnough ("usage", words[0]))
|
||||
output = "\n"
|
||||
output = '\n'
|
||||
+ composeUsage ()
|
||||
+ "\n";
|
||||
+ '\n';
|
||||
else
|
||||
output = "\n"
|
||||
output = '\n'
|
||||
+ composeUsage ()
|
||||
+ "\n"
|
||||
+ '\n'
|
||||
+ STRING_CMD_HELP_TEXT;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -174,7 +174,7 @@ int CmdHistoryMonthly::execute (std::string& output)
|
|||
if (view.rows ())
|
||||
{
|
||||
row = view.addRow ();
|
||||
view.set (row, 0, " ");
|
||||
view.set (row, 0, ' ');
|
||||
row = view.addRow ();
|
||||
|
||||
Color row_color;
|
||||
|
@ -192,7 +192,7 @@ int CmdHistoryMonthly::execute (std::string& output)
|
|||
if (view.rows ())
|
||||
out << optionalBlankLine ()
|
||||
<< view.render ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
else
|
||||
{
|
||||
context.footnote (STRING_FEEDBACK_NO_TASKS);
|
||||
|
@ -354,7 +354,7 @@ int CmdHistoryAnnual::execute (std::string& output)
|
|||
if (view.rows ())
|
||||
out << optionalBlankLine ()
|
||||
<< view.render ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
else
|
||||
{
|
||||
context.footnote (STRING_FEEDBACK_NO_TASKS);
|
||||
|
@ -498,7 +498,7 @@ int CmdGHistoryMonthly::execute (std::string& output)
|
|||
{
|
||||
aBar = format (addedGroup[i.first]);
|
||||
while (aBar.length () < addedBar)
|
||||
aBar = " " + aBar;
|
||||
aBar = ' ' + aBar;
|
||||
}
|
||||
|
||||
std::string cBar = "";
|
||||
|
@ -506,7 +506,7 @@ int CmdGHistoryMonthly::execute (std::string& output)
|
|||
{
|
||||
cBar = format (completedGroup[i.first]);
|
||||
while (cBar.length () < completedBar)
|
||||
cBar = " " + cBar;
|
||||
cBar = ' ' + cBar;
|
||||
}
|
||||
|
||||
std::string dBar = "";
|
||||
|
@ -514,7 +514,7 @@ int CmdGHistoryMonthly::execute (std::string& output)
|
|||
{
|
||||
dBar = format (deletedGroup[i.first]);
|
||||
while (dBar.length () < deletedBar)
|
||||
dBar = " " + dBar;
|
||||
dBar = ' ' + dBar;
|
||||
}
|
||||
|
||||
bar += std::string (leftOffset - aBar.length (), ' ');
|
||||
|
@ -542,7 +542,7 @@ int CmdGHistoryMonthly::execute (std::string& output)
|
|||
{
|
||||
out << optionalBlankLine ()
|
||||
<< view.render ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
if (context.color ())
|
||||
out << format (STRING_CMD_HISTORY_LEGEND,
|
||||
|
@ -550,10 +550,10 @@ int CmdGHistoryMonthly::execute (std::string& output)
|
|||
color_done.colorize (STRING_CMD_HISTORY_COMP),
|
||||
color_delete.colorize (STRING_CMD_HISTORY_DEL))
|
||||
<< optionalBlankLine ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
else
|
||||
out << STRING_CMD_HISTORY_LEGEND_A
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -696,7 +696,7 @@ int CmdGHistoryAnnual::execute (std::string& output)
|
|||
{
|
||||
aBar = format (addedGroup[i.first]);
|
||||
while (aBar.length () < addedBar)
|
||||
aBar = " " + aBar;
|
||||
aBar = ' ' + aBar;
|
||||
}
|
||||
|
||||
std::string cBar = "";
|
||||
|
@ -704,7 +704,7 @@ int CmdGHistoryAnnual::execute (std::string& output)
|
|||
{
|
||||
cBar = format (completedGroup[i.first]);
|
||||
while (cBar.length () < completedBar)
|
||||
cBar = " " + cBar;
|
||||
cBar = ' ' + cBar;
|
||||
}
|
||||
|
||||
std::string dBar = "";
|
||||
|
@ -712,7 +712,7 @@ int CmdGHistoryAnnual::execute (std::string& output)
|
|||
{
|
||||
dBar = format (deletedGroup[i.first]);
|
||||
while (dBar.length () < deletedBar)
|
||||
dBar = " " + dBar;
|
||||
dBar = ' ' + dBar;
|
||||
}
|
||||
|
||||
bar += std::string (leftOffset - aBar.length (), ' ');
|
||||
|
@ -739,7 +739,7 @@ int CmdGHistoryAnnual::execute (std::string& output)
|
|||
{
|
||||
out << optionalBlankLine ()
|
||||
<< view.render ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
if (context.color ())
|
||||
out << format (STRING_CMD_HISTORY_LEGEND,
|
||||
|
@ -747,10 +747,10 @@ int CmdGHistoryAnnual::execute (std::string& output)
|
|||
color_done.colorize (STRING_CMD_HISTORY_COMP),
|
||||
color_delete.colorize (STRING_CMD_HISTORY_DEL))
|
||||
<< optionalBlankLine ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
else
|
||||
out << STRING_CMD_HISTORY_LEGEND_A
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -70,7 +70,7 @@ int CmdIDs::execute (std::string& output)
|
|||
ids.push_back (task.id);
|
||||
|
||||
std::sort (ids.begin (), ids.end ());
|
||||
output = compressIds (ids) + "\n";
|
||||
output = compressIds (ids) + '\n';
|
||||
|
||||
context.headers.clear ();
|
||||
return 0;
|
||||
|
@ -100,7 +100,7 @@ std::string CmdIDs::compressIds (const std::vector <int>& ids)
|
|||
if (i + 1 == ids.size ())
|
||||
{
|
||||
if (result.str ().length ())
|
||||
result << " ";
|
||||
result << ' ';
|
||||
|
||||
if (range_start < range_end)
|
||||
result << ids[range_start] << "-" << ids[range_end];
|
||||
|
@ -116,7 +116,7 @@ std::string CmdIDs::compressIds (const std::vector <int>& ids)
|
|||
else
|
||||
{
|
||||
if (result.str ().length ())
|
||||
result << " ";
|
||||
result << ' ';
|
||||
|
||||
if (range_start < range_end)
|
||||
result << ids[range_start] << "-" << ids[range_end];
|
||||
|
@ -164,7 +164,7 @@ int CmdCompletionIds::execute (std::string& output)
|
|||
|
||||
std::sort (ids.begin (), ids.end ());
|
||||
join (output, "\n", ids);
|
||||
output += "\n";
|
||||
output += '\n';
|
||||
|
||||
context.headers.clear ();
|
||||
return 0;
|
||||
|
@ -200,9 +200,9 @@ int CmdZshCompletionIds::execute (std::string& output)
|
|||
if (task.getStatus () != Task::deleted &&
|
||||
task.getStatus () != Task::completed)
|
||||
out << task.id
|
||||
<< ":"
|
||||
<< ':'
|
||||
<< str_replace(task.get ("description"), ":", zshColonReplacement)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
output = out.str ();
|
||||
|
||||
|
@ -241,7 +241,7 @@ int CmdUUIDs::execute (std::string& output)
|
|||
|
||||
std::sort (uuids.begin (), uuids.end ());
|
||||
join (output, " ", uuids);
|
||||
output += "\n";
|
||||
output += '\n';
|
||||
|
||||
context.headers.clear ();
|
||||
return 0;
|
||||
|
@ -278,7 +278,7 @@ int CmdCompletionUuids::execute (std::string& output)
|
|||
|
||||
std::sort (uuids.begin (), uuids.end ());
|
||||
join (output, "\n", uuids);
|
||||
output += "\n";
|
||||
output += '\n';
|
||||
|
||||
context.headers.clear ();
|
||||
return 0;
|
||||
|
@ -314,7 +314,7 @@ int CmdZshCompletionUuids::execute (std::string& output)
|
|||
out << task.get ("uuid")
|
||||
<< ":"
|
||||
<< str_replace (task.get ("description"), ":", zshColonReplacement)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
output = out.str ();
|
||||
|
||||
|
|
|
@ -64,12 +64,12 @@ int CmdImport::execute (std::string&)
|
|||
std::vector <std::string> words = context.cli2.getWords ();
|
||||
if (! words.size () || (words.size () == 1 && words[0] == "-"))
|
||||
{
|
||||
std::cout << format (STRING_CMD_IMPORT_FILE, "STDIN") << "\n";
|
||||
std::cout << format (STRING_CMD_IMPORT_FILE, "STDIN") << '\n';
|
||||
|
||||
std::string json;
|
||||
std::string line;
|
||||
while (std::getline (std::cin, line))
|
||||
json += line + "\n";
|
||||
json += line + '\n';
|
||||
|
||||
if (nontrivial (json))
|
||||
count = import (json);
|
||||
|
@ -83,7 +83,7 @@ int CmdImport::execute (std::string&)
|
|||
if (! incoming.exists ())
|
||||
throw format (STRING_CMD_IMPORT_MISSING, word);
|
||||
|
||||
std::cout << format (STRING_CMD_IMPORT_FILE, word) << "\n";
|
||||
std::cout << format (STRING_CMD_IMPORT_FILE, word) << '\n';
|
||||
|
||||
// Load the file.
|
||||
std::string json;
|
||||
|
@ -224,9 +224,9 @@ void CmdImport::importSingleTask (json::object* obj)
|
|||
}
|
||||
|
||||
std::cout << task.get ("uuid")
|
||||
<< " "
|
||||
<< ' '
|
||||
<< task.get ("description")
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -130,10 +130,10 @@ int CmdInfo::execute (std::string& output)
|
|||
std::map <std::string, std::string> annotations;
|
||||
task.getAnnotations (annotations);
|
||||
for (auto& anno : annotations)
|
||||
description += "\n"
|
||||
description += '\n'
|
||||
+ std::string (indent, ' ')
|
||||
+ ISO8601d (anno.first.substr (11)).toString (dateformatanno)
|
||||
+ " "
|
||||
+ ' '
|
||||
+ anno.second;
|
||||
|
||||
row = view.addRow ();
|
||||
|
@ -161,7 +161,7 @@ int CmdInfo::execute (std::string& output)
|
|||
{
|
||||
std::stringstream message;
|
||||
for (auto& block : blocked)
|
||||
message << block.id << " " << block.get ("description") << "\n";
|
||||
message << block.id << ' ' << block.get ("description") << '\n';
|
||||
|
||||
row = view.addRow ();
|
||||
view.set (row, 0, STRING_CMD_INFO_BLOCKED);
|
||||
|
@ -177,7 +177,7 @@ int CmdInfo::execute (std::string& output)
|
|||
{
|
||||
std::stringstream message;
|
||||
for (auto& block : blocking)
|
||||
message << block.id << " " << block.get ("description") << "\n";
|
||||
message << block.id << ' ' << block.get ("description") << '\n';
|
||||
|
||||
row = view.addRow ();
|
||||
view.set (row, 0, STRING_CMD_INFO_BLOCKING);
|
||||
|
@ -558,15 +558,15 @@ int CmdInfo::execute (std::string& output)
|
|||
|
||||
out << optionalBlankLine ()
|
||||
<< view.render ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
if (urgencyDetails.rows () > 0)
|
||||
out << urgencyDetails.render ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
if (journal.rows () > 0)
|
||||
out << journal.render ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
|
||||
output = out.str ();
|
||||
|
|
|
@ -72,7 +72,7 @@ int CmdLog::execute (std::string& output)
|
|||
context.footnote (onProjectChange (task));
|
||||
|
||||
if (context.verbose ("new-uuid"))
|
||||
output = format (STRING_CMD_LOG_LOGGED, task.get ("uuid")) + "\n";
|
||||
output = format (STRING_CMD_LOG_LOGGED, task.get ("uuid")) + '\n';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ int CmdLogo::execute (std::string& output)
|
|||
}
|
||||
}
|
||||
|
||||
output += "\n";
|
||||
output += '\n';
|
||||
}
|
||||
|
||||
output += optionalBlankLine ();
|
||||
|
|
|
@ -92,7 +92,7 @@ int CmdModify::execute (std::string&)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << STRING_CMD_MODIFY_NO << "\n";
|
||||
std::cout << STRING_CMD_MODIFY_NO << '\n';
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
|
|
|
@ -118,7 +118,7 @@ int CmdPrepend::execute (std::string&)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << STRING_CMD_PREPEND_NO << "\n";
|
||||
std::cout << STRING_CMD_PREPEND_NO << '\n';
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
|
|
|
@ -147,15 +147,15 @@ int CmdProjects::execute (std::string& output)
|
|||
<< (number_projects == 1
|
||||
? format (STRING_CMD_PROJECTS_SUMMARY, number_projects)
|
||||
: format (STRING_CMD_PROJECTS_SUMMARY2, number_projects))
|
||||
<< " "
|
||||
<< ' '
|
||||
<< (quantity == 1
|
||||
? format (STRING_CMD_PROJECTS_TASK, quantity)
|
||||
: format (STRING_CMD_PROJECTS_TASKS, quantity))
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
out << STRING_CMD_PROJECTS_NO << "\n";
|
||||
out << STRING_CMD_PROJECTS_NO << '\n';
|
||||
rc = 1;
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ int CmdCompletionProjects::execute (std::string& output)
|
|||
|
||||
for (auto& project : unique)
|
||||
if (project.first.length ())
|
||||
output += project.first + "\n";
|
||||
output += project.first + '\n';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ int CmdReports::execute (std::string& output)
|
|||
<< view.render ()
|
||||
<< optionalBlankLine ()
|
||||
<< format (STRING_CMD_REPORTS_SUMMARY, reports.size ())
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
output = out.str ();
|
||||
return 0;
|
||||
|
|
|
@ -222,7 +222,7 @@ int CmdShow::execute (std::string& output)
|
|||
{
|
||||
// Disallow partial matches by tacking a leading and trailing space on each
|
||||
// variable name.
|
||||
std::string pattern = " " + i.first + " ";
|
||||
std::string pattern = ' ' + i.first + ' ';
|
||||
if (recognized.find (pattern) == std::string::npos)
|
||||
{
|
||||
// These are special configuration variables, because their name is
|
||||
|
@ -320,14 +320,14 @@ int CmdShow::execute (std::string& output)
|
|||
}
|
||||
}
|
||||
|
||||
out << "\n"
|
||||
out << '\n'
|
||||
<< view.render ()
|
||||
<< (view.rows () == 0 ? STRING_CMD_SHOW_NONE : "")
|
||||
<< (view.rows () == 0 ? "\n\n" : "\n");
|
||||
|
||||
if (issue_warning)
|
||||
{
|
||||
out << STRING_CMD_SHOW_DIFFER << "\n";
|
||||
out << STRING_CMD_SHOW_DIFFER << '\n';
|
||||
|
||||
if (context.color () && warning.nontrivial ())
|
||||
out << " "
|
||||
|
@ -338,13 +338,13 @@ int CmdShow::execute (std::string& output)
|
|||
// Display the unrecognized variables.
|
||||
if (issue_error)
|
||||
{
|
||||
out << STRING_CMD_SHOW_UNREC << "\n";
|
||||
out << STRING_CMD_SHOW_UNREC << '\n';
|
||||
|
||||
for (auto& i : unrecognized)
|
||||
out << " " << i << "\n";
|
||||
out << " " << i << '\n';
|
||||
|
||||
if (context.color () && error.nontrivial ())
|
||||
out << "\n" << format (STRING_CMD_SHOW_DIFFER_COLOR, error.colorize ("color"));
|
||||
out << '\n' << format (STRING_CMD_SHOW_DIFFER_COLOR, error.colorize ("color"));
|
||||
|
||||
out << "\n\n";
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ int CmdShow::execute (std::string& output)
|
|||
calendardetails != "sparse" &&
|
||||
calendardetails != "none")
|
||||
out << format (STRING_CMD_SHOW_CONFIG_ERROR, "calendar.details", calendardetails)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
// Check for bad values in rc.calendar.holidays.
|
||||
std::string calendarholidays = context.config.get ("calendar.holidays");
|
||||
|
@ -369,14 +369,14 @@ int CmdShow::execute (std::string& output)
|
|||
calendarholidays != "sparse" &&
|
||||
calendarholidays != "none")
|
||||
out << format (STRING_CMD_SHOW_CONFIG_ERROR, "calendar.holidays", calendarholidays)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
// Verify installation. This is mentioned in the documentation as the way
|
||||
// to ensure everything is properly installed.
|
||||
|
||||
if (context.config.size () == 0)
|
||||
{
|
||||
out << STRING_CMD_SHOW_EMPTY << "\n";
|
||||
out << STRING_CMD_SHOW_EMPTY << '\n';
|
||||
rc = 1;
|
||||
}
|
||||
else
|
||||
|
@ -384,10 +384,10 @@ int CmdShow::execute (std::string& output)
|
|||
Directory location (context.config.get ("data.location"));
|
||||
|
||||
if (location._data == "")
|
||||
out << STRING_CMD_SHOW_NO_LOCATION << "\n";
|
||||
out << STRING_CMD_SHOW_NO_LOCATION << '\n';
|
||||
|
||||
if (! location.exists ())
|
||||
out << STRING_CMD_SHOW_LOC_EXIST << "\n";
|
||||
out << STRING_CMD_SHOW_LOC_EXIST << '\n';
|
||||
}
|
||||
|
||||
output = out.str ();
|
||||
|
@ -418,7 +418,7 @@ int CmdShowRaw::execute (std::string& output)
|
|||
// Display them all.
|
||||
std::stringstream out;
|
||||
for (auto& i : all)
|
||||
out << i << '=' << context.config.get (i) << "\n";
|
||||
out << i << '=' << context.config.get (i) << '\n';
|
||||
|
||||
output = out.str ();
|
||||
return 0;
|
||||
|
|
|
@ -109,7 +109,7 @@ int CmdStart::execute (std::string&)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << STRING_CMD_START_NO << "\n";
|
||||
std::cout << STRING_CMD_START_NO << '\n';
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
|
@ -120,7 +120,7 @@ int CmdStart::execute (std::string&)
|
|||
std::cout << format (STRING_CMD_START_ALREADY,
|
||||
task.id,
|
||||
task.get ("description"))
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ int CmdStop::execute (std::string&)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << STRING_CMD_STOP_NO << "\n";
|
||||
std::cout << STRING_CMD_STOP_NO << '\n';
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
|
@ -110,7 +110,7 @@ int CmdStop::execute (std::string&)
|
|||
std::cout << format (STRING_CMD_STOP_ALREADY,
|
||||
task.identifier (true),
|
||||
task.get ("description"))
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -212,11 +212,11 @@ int CmdSummary::execute (std::string& output)
|
|||
<< view.render ()
|
||||
<< optionalBlankLine ();
|
||||
|
||||
out << format (STRING_CMD_PROJECTS_SUMMARY2, view.rows ()) << "\n";
|
||||
out << format (STRING_CMD_PROJECTS_SUMMARY2, view.rows ()) << '\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
out << STRING_CMD_PROJECTS_NO << "\n";
|
||||
out << STRING_CMD_PROJECTS_NO << '\n';
|
||||
rc = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ int CmdSync::execute (std::string& output)
|
|||
auto all_tasks = context.tdb2.all_tasks ();
|
||||
for (auto& i : all_tasks)
|
||||
{
|
||||
payload += i.composeJSON () + "\n";
|
||||
payload += i.composeJSON () + '\n';
|
||||
++upload_count;
|
||||
}
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ int CmdSync::execute (std::string& output)
|
|||
if (i[0] == '{')
|
||||
++upload_count;
|
||||
|
||||
payload += i + "\n";
|
||||
payload += i + '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ int CmdSync::execute (std::string& output)
|
|||
|
||||
if (context.verbose ("sync"))
|
||||
out << format (STRING_CMD_SYNC_PROGRESS, connection)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
// Ignore harmful signals.
|
||||
signal (SIGHUP, SIG_IGN);
|
||||
|
@ -227,7 +227,7 @@ int CmdSync::execute (std::string& output)
|
|||
format (STRING_CMD_SYNC_MOD,
|
||||
uuid,
|
||||
from_server.get ("description")))
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
context.tdb2.modify (from_server, false);
|
||||
}
|
||||
else
|
||||
|
@ -238,7 +238,7 @@ int CmdSync::execute (std::string& output)
|
|||
format (STRING_CMD_SYNC_ADD,
|
||||
uuid,
|
||||
from_server.get ("description")))
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
context.tdb2.add (from_server, false);
|
||||
}
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ int CmdSync::execute (std::string& output)
|
|||
context.tdb2.backlog._file.truncate ();
|
||||
context.tdb2.backlog.clear_tasks ();
|
||||
context.tdb2.backlog.clear_lines ();
|
||||
context.tdb2.backlog.add_line (sync_key + "\n");
|
||||
context.tdb2.backlog.add_line (sync_key + '\n');
|
||||
|
||||
// Present a clear status message.
|
||||
if (upload_count == 0 && download_count == 0)
|
||||
|
@ -326,7 +326,7 @@ int CmdSync::execute (std::string& output)
|
|||
}
|
||||
|
||||
if (context.verbose ("sync"))
|
||||
out << "\n";
|
||||
out << '\n';
|
||||
output = out.str ();
|
||||
|
||||
// Restore signal handling.
|
||||
|
@ -373,7 +373,7 @@ bool CmdSync::send (
|
|||
client.ciphers (context.config.get ("taskd.ciphers"));
|
||||
client.init (ca, certificate, key);
|
||||
client.connect (server, port);
|
||||
client.send (request.serialize () + "\n");
|
||||
client.send (request.serialize () + '\n');
|
||||
|
||||
std::string incoming;
|
||||
client.recv (incoming);
|
||||
|
|
|
@ -134,7 +134,7 @@ int CmdTags::execute (std::string& output)
|
|||
else
|
||||
context.footnote (format (STRING_FEEDBACK_TASKS_PLURAL, quantity));
|
||||
|
||||
out << "\n";
|
||||
out << '\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -224,7 +224,7 @@ int CmdCompletionTags::execute (std::string& output)
|
|||
|
||||
std::stringstream out;
|
||||
for (auto& it : unique)
|
||||
out << it.first << "\n";
|
||||
out << it.first << '\n';
|
||||
|
||||
output = out.str ();
|
||||
return 0;
|
||||
|
|
|
@ -97,9 +97,9 @@ int CmdTimesheet::execute (std::string& output)
|
|||
if (context.color ())
|
||||
bold = Color ("bold");
|
||||
|
||||
out << "\n"
|
||||
out << '\n'
|
||||
<< bold.colorize (title)
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
// Render the completed table.
|
||||
ViewText completed;
|
||||
|
@ -145,10 +145,10 @@ int CmdTimesheet::execute (std::string& output)
|
|||
std::map <std::string, std::string> annotations;
|
||||
task.getAnnotations (annotations);
|
||||
for (auto& ann : annotations)
|
||||
description += "\n"
|
||||
description += '\n'
|
||||
+ std::string (indent, ' ')
|
||||
+ ISO8601d (ann.first.substr (11)).toString (context.config.get ("dateformat"))
|
||||
+ " "
|
||||
+ ' '
|
||||
+ ann.second;
|
||||
|
||||
completed.set (row, 3, description, c);
|
||||
|
@ -156,11 +156,11 @@ int CmdTimesheet::execute (std::string& output)
|
|||
}
|
||||
}
|
||||
|
||||
out << " " << format (STRING_CMD_TIMESHEET_DONE, completed.rows ()) << "\n";
|
||||
out << " " << format (STRING_CMD_TIMESHEET_DONE, completed.rows ()) << '\n';
|
||||
|
||||
if (completed.rows ())
|
||||
out << completed.render ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
// Now render the started table.
|
||||
ViewText started;
|
||||
|
@ -201,10 +201,10 @@ int CmdTimesheet::execute (std::string& output)
|
|||
std::map <std::string, std::string> annotations;
|
||||
task.getAnnotations (annotations);
|
||||
for (auto& ann : annotations)
|
||||
description += "\n"
|
||||
description += '\n'
|
||||
+ std::string (indent, ' ')
|
||||
+ ISO8601d (ann.first.substr (11)).toString (context.config.get ("dateformat"))
|
||||
+ " "
|
||||
+ ' '
|
||||
+ ann.second;
|
||||
|
||||
started.set (row, 3, description, c);
|
||||
|
@ -212,7 +212,7 @@ int CmdTimesheet::execute (std::string& output)
|
|||
}
|
||||
}
|
||||
|
||||
out << " " << format (STRING_CMD_TIMESHEET_STARTED, started.rows ()) << "\n";
|
||||
out << " " << format (STRING_CMD_TIMESHEET_STARTED, started.rows ()) << '\n';
|
||||
|
||||
if (started.rows ())
|
||||
out << started.render ()
|
||||
|
|
|
@ -128,11 +128,11 @@ int CmdUDAs::execute (std::string& output)
|
|||
<< (udas.size () == 1
|
||||
? format (STRING_CMD_UDAS_SUMMARY, udas.size ())
|
||||
: format (STRING_CMD_UDAS_SUMMARY2, udas.size ()))
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
out << STRING_CMD_UDAS_NO << "\n";
|
||||
out << STRING_CMD_UDAS_NO << '\n';
|
||||
rc = 1;
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ int CmdUDAs::execute (std::string& output)
|
|||
<< (udas.size () == 1
|
||||
? format (STRING_CMD_UDAS_ORPHAN, orphans.size ())
|
||||
: format (STRING_CMD_UDAS_ORPHANS, orphans.size ()))
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
|
||||
output = out.str ();
|
||||
|
@ -215,7 +215,7 @@ int CmdCompletionUDAs::execute (std::string& output)
|
|||
{
|
||||
std::sort (udas.begin (), udas.end ());
|
||||
join (output, "\n", udas);
|
||||
output += "\n";
|
||||
output += '\n';
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -87,7 +87,7 @@ int CmdUnique::execute (std::string& output)
|
|||
|
||||
// Generate list of unique values.
|
||||
for (auto& value : values)
|
||||
output += value + "\n";
|
||||
output += value + '\n';
|
||||
|
||||
context.headers.clear ();
|
||||
return 0;
|
||||
|
|
|
@ -74,7 +74,7 @@ int CmdUrgency::execute (std::string& output)
|
|||
out << format (STRING_CMD_URGENCY_RESULT,
|
||||
task.identifier (),
|
||||
Lexer::trim (format (task.urgency (), 6, 3)))
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
}
|
||||
|
||||
output = out.str ();
|
||||
|
|
|
@ -76,7 +76,7 @@ int CmdVersion::execute (std::string& output)
|
|||
if (context.color ())
|
||||
bold = Color ("bold");
|
||||
|
||||
out << "\n"
|
||||
out << '\n'
|
||||
<< format (STRING_CMD_VERSION_BUILT, bold.colorize (PACKAGE), bold.colorize (VERSION))
|
||||
|
||||
#if defined (DARWIN)
|
||||
|
@ -104,23 +104,23 @@ int CmdVersion::execute (std::string& output)
|
|||
#endif
|
||||
|
||||
#if PACKAGE_LANGUAGE != LANGUAGE_ENG_USA
|
||||
<< " "
|
||||
<< ' '
|
||||
<< STRING_LOCALIZATION_DESC
|
||||
#endif
|
||||
|
||||
<< "\n"
|
||||
<< '\n'
|
||||
<< STRING_CMD_VERSION_COPY
|
||||
<< "\n"
|
||||
<< "\n"
|
||||
<< '\n'
|
||||
<< '\n'
|
||||
<< disclaimer.render ()
|
||||
<< "\n"
|
||||
<< '\n'
|
||||
<< link.render ()
|
||||
<< "\n";
|
||||
<< '\n';
|
||||
|
||||
#if PACKAGE_LANGUAGE != LANGUAGE_ENG_USA
|
||||
out << STRING_LOCALIZATION_AUTHOR
|
||||
<< "\n"
|
||||
<< "\n";
|
||||
<< '\n'
|
||||
<< '\n';
|
||||
#endif
|
||||
|
||||
output = out.str ();
|
||||
|
@ -154,7 +154,7 @@ int CmdCompletionVersion::execute (std::string& output)
|
|||
#else
|
||||
output = VERSION;
|
||||
#endif
|
||||
output += "\n";
|
||||
output += '\n';
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -350,7 +350,7 @@ bool Command::permission (
|
|||
return true;
|
||||
|
||||
if (context.verbose ("blank") && !_first_iteration)
|
||||
std::cout << "\n";
|
||||
std::cout << '\n';
|
||||
int answer = confirm4 (question);
|
||||
_first_iteration = false;
|
||||
switch (answer)
|
||||
|
|
|
@ -67,7 +67,6 @@ void dependencyGetBlocking (const Task& task, std::vector <Task>& blocking)
|
|||
// Returns true if the supplied task adds a cycle to the dependency chain.
|
||||
bool dependencyIsCircular (const Task& task)
|
||||
{
|
||||
|
||||
// A new task has no UUID assigned yet, and therefore cannot be part of any
|
||||
// dependency chain.
|
||||
if (task.has ("uuid"))
|
||||
|
@ -163,7 +162,7 @@ void dependencyChainOnComplete (Task& task)
|
|||
<< "\n";
|
||||
|
||||
for (auto& b : blocking)
|
||||
std::cout << " " << b.id << " " << b.get ("description") << "\n";
|
||||
std::cout << " " << b.id << ' ' << b.get ("description") << "\n";
|
||||
}
|
||||
|
||||
// If there are both blocking and blocked tasks, the chain is broken.
|
||||
|
@ -175,7 +174,7 @@ void dependencyChainOnComplete (Task& task)
|
|||
<< "\n";
|
||||
|
||||
for (auto& b : blocked)
|
||||
std::cout << " " << b.id << " " << b.get ("description") << "\n";
|
||||
std::cout << " " << b.id << ' ' << b.get ("description") << "\n";
|
||||
}
|
||||
|
||||
if (!context.config.getBoolean ("dependency.confirmation") ||
|
||||
|
@ -218,7 +217,7 @@ void dependencyChainOnStart (Task& task)
|
|||
<< "\n";
|
||||
|
||||
for (auto& b : blocking)
|
||||
std::cout << " " << b.id << " " << b.get ("description") << "\n";
|
||||
std::cout << " " << b.id << ' ' << b.get ("description") << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -478,7 +478,7 @@ std::string onProjectChange (Task& task, bool scope /* = true */)
|
|||
percentage = (count_done * 100 / (count_done + count_pending));
|
||||
|
||||
msg << format (STRING_HELPER_PROJECT_COMPL, project, percentage)
|
||||
<< " ";
|
||||
<< ' ';
|
||||
|
||||
if (count_pending == 1 && count_done == 0)
|
||||
msg << format (STRING_HELPER_PROJECT_REM1, count_pending);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue