mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
text: Removed local join/split implementation
This commit is contained in:
parent
db0f8d33e1
commit
232d266fb5
11 changed files with 18 additions and 277 deletions
|
@ -37,6 +37,7 @@
|
|||
#include <ViewTask.h>
|
||||
#include <i18n.h>
|
||||
#include <format.h>
|
||||
#include <shared.h>
|
||||
#include <text.h>
|
||||
#include <main.h>
|
||||
|
||||
|
@ -72,18 +73,15 @@ int CmdCustom::execute (std::string& output)
|
|||
std::string reportSort = context.config.get ("report." + _keyword + ".sort");
|
||||
std::string reportFilter = context.config.get ("report." + _keyword + ".filter");
|
||||
|
||||
std::vector <std::string> columns;
|
||||
split (columns, reportColumns, ',');
|
||||
auto columns = split (reportColumns, ',');
|
||||
validateReportColumns (columns);
|
||||
|
||||
std::vector <std::string> labels;
|
||||
split (labels, reportLabels, ',');
|
||||
auto labels = split (reportLabels, ',');
|
||||
|
||||
if (columns.size () != labels.size () && labels.size () != 0)
|
||||
throw format (STRING_CMD_CUSTOM_MISMATCH, _keyword);
|
||||
|
||||
std::vector <std::string> sortOrder;
|
||||
split (sortOrder, reportSort, ',');
|
||||
auto sortOrder = split (reportSort, ',');
|
||||
if (sortOrder.size () != 0 &&
|
||||
sortOrder[0] != "none")
|
||||
validateSortColumns (sortOrder);
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <Context.h>
|
||||
#include <i18n.h>
|
||||
#include <text.h>
|
||||
#include <shared.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
|
@ -52,9 +52,7 @@ CmdExec::CmdExec ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdExec::execute (std::string&)
|
||||
{
|
||||
std::string command_line;
|
||||
join (command_line, " ", context.cli2.getWords ());
|
||||
return system (command_line.c_str ());
|
||||
return system (join (" ", context.cli2.getWords ()).c_str ());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <Context.h>
|
||||
#include <Filter.h>
|
||||
#include <format.h>
|
||||
#include <shared.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
|
@ -147,10 +148,7 @@ int CmdImport::import (const std::string& input)
|
|||
// { ... }
|
||||
catch (std::string& e)
|
||||
{
|
||||
std::vector <std::string> lines;
|
||||
split (lines, input, '\n');
|
||||
|
||||
for (auto& line : lines)
|
||||
for (auto& line : split (input, '\n'))
|
||||
{
|
||||
if (line.length ())
|
||||
{
|
||||
|
|
|
@ -299,8 +299,7 @@ int CmdInfo::execute (std::string& output)
|
|||
task.getTags (tags);
|
||||
if (tags.size ())
|
||||
{
|
||||
std::string allTags;
|
||||
join (allTags, " ", tags);
|
||||
auto allTags = join (" ", tags);
|
||||
|
||||
row = view.addRow ();
|
||||
view.set (row, 0, STRING_COLUMN_LABEL_TAGS);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <Filter.h>
|
||||
#include <main.h>
|
||||
#include <format.h>
|
||||
#include <shared.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
|
@ -215,8 +216,7 @@ int CmdCompletionUDAs::execute (std::string& output)
|
|||
if (udas.size ())
|
||||
{
|
||||
std::sort (udas.begin (), udas.end ());
|
||||
join (output, "\n", udas);
|
||||
output += '\n';
|
||||
output = join ("\n", udas) + '\n';
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue