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 <stdlib.h>
|
||||
#include <Context.h>
|
||||
#include <i18n.h>
|
||||
#include <text.h>
|
||||
#include <CmdExec.h>
|
||||
|
||||
extern Context context;
|
||||
|
@ -46,21 +48,7 @@ CmdExec::CmdExec ()
|
|||
int CmdExec::execute (std::string& output)
|
||||
{
|
||||
std::string command_line;
|
||||
std::vector <Arg>::iterator arg;
|
||||
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 + "'";
|
||||
}
|
||||
}
|
||||
|
||||
join (command_line, " ", context.a3t.getWords ());
|
||||
return system (command_line.c_str ());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue