mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CmdCustom: Code cleanup
This commit is contained in:
parent
984b20f6de
commit
31b1e5e462
1 changed files with 8 additions and 8 deletions
|
@ -65,13 +65,13 @@ CmdCustom::CmdCustom (
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int CmdCustom::execute (std::string& output)
|
int CmdCustom::execute (std::string& output)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
auto rc = 0;
|
||||||
|
|
||||||
// Load report configuration.
|
// Load report configuration.
|
||||||
std::string reportColumns = context.config.get ("report." + _keyword + ".columns");
|
auto reportColumns = context.config.get ("report." + _keyword + ".columns");
|
||||||
std::string reportLabels = context.config.get ("report." + _keyword + ".labels");
|
auto reportLabels = context.config.get ("report." + _keyword + ".labels");
|
||||||
std::string reportSort = context.config.get ("report." + _keyword + ".sort");
|
auto reportSort = context.config.get ("report." + _keyword + ".sort");
|
||||||
std::string reportFilter = context.config.get ("report." + _keyword + ".filter");
|
auto reportFilter = context.config.get ("report." + _keyword + ".filter");
|
||||||
|
|
||||||
auto columns = split (reportColumns, ',');
|
auto columns = split (reportColumns, ',');
|
||||||
validateReportColumns (columns);
|
validateReportColumns (columns);
|
||||||
|
@ -149,7 +149,7 @@ int CmdCustom::execute (std::string& output)
|
||||||
std::vector <std::string> sortColumns;
|
std::vector <std::string> sortColumns;
|
||||||
|
|
||||||
// Add the break columns, if any.
|
// Add the break columns, if any.
|
||||||
for (auto& so : sortOrder)
|
for (const auto& so : sortOrder)
|
||||||
{
|
{
|
||||||
std::string name;
|
std::string name;
|
||||||
bool ascending;
|
bool ascending;
|
||||||
|
@ -187,8 +187,8 @@ int CmdCustom::execute (std::string& output)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Report output can be limited by rows or lines.
|
// Report output can be limited by rows or lines.
|
||||||
int maxrows = 0;
|
auto maxrows = 0;
|
||||||
int maxlines = 0;
|
auto maxlines = 0;
|
||||||
context.getLimits (maxrows, maxlines);
|
context.getLimits (maxrows, maxlines);
|
||||||
|
|
||||||
// Adjust for fluff in the output.
|
// Adjust for fluff in the output.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue