mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CmdExec
- Converted from A3 to A3t. - Standardized on A3t::getWords, and unquoted args to run. This ought to fix a bug, but I'm on a plane and cannot look at the bug right now.
This commit is contained in:
parent
c5fd2700ef
commit
763ded488c
1 changed files with 3 additions and 15 deletions
|
@ -24,10 +24,12 @@
|
||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include <iostream> // TODO Remove
|
||||||
#include <cmake.h>
|
#include <cmake.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <Context.h>
|
#include <Context.h>
|
||||||
#include <i18n.h>
|
#include <i18n.h>
|
||||||
|
#include <text.h>
|
||||||
#include <CmdExec.h>
|
#include <CmdExec.h>
|
||||||
|
|
||||||
extern Context context;
|
extern Context context;
|
||||||
|
@ -46,21 +48,7 @@ CmdExec::CmdExec ()
|
||||||
int CmdExec::execute (std::string& output)
|
int CmdExec::execute (std::string& output)
|
||||||
{
|
{
|
||||||
std::string command_line;
|
std::string command_line;
|
||||||
std::vector <Arg>::iterator arg;
|
join (command_line, " ", context.a3t.getWords ());
|
||||||
for (arg = context.a3.begin (); arg != context.a3.end (); ++arg)
|
|
||||||
{
|
|
||||||
if (arg != context.a3.begin () &&
|
|
||||||
arg->_raw != "execute" &&
|
|
||||||
arg->_category != Arg::cat_rc &&
|
|
||||||
arg->_category != Arg::cat_override)
|
|
||||||
{
|
|
||||||
if (command_line.length ())
|
|
||||||
command_line += " ";
|
|
||||||
|
|
||||||
command_line += "'" + arg->_raw + "'";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return system (command_line.c_str ());
|
return system (command_line.c_str ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue