mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Argument Parsing
- Obsoleted Command::exectute 'commandLine' argument. It is worse than unnecessary, it is an uncategorized raw argument string, which is only really useful for the 'execute' command, which itself now calls Arguments::combine to reconstruct the command line string.
This commit is contained in:
parent
c2e1757fb6
commit
644d027a87
99 changed files with 397 additions and 289 deletions
|
@ -26,8 +26,11 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <Context.h>
|
||||
#include <CmdExec.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
CmdExec::CmdExec ()
|
||||
{
|
||||
|
@ -39,8 +42,17 @@ CmdExec::CmdExec ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdExec::execute (const std::string& command_line, std::string&)
|
||||
int CmdExec::execute (std::string& output)
|
||||
{
|
||||
std::string command_line;
|
||||
std::vector <std::pair <std::string, std::string> >::iterator arg;
|
||||
for (arg = context.args.begin (); arg != context.args.end (); ++arg)
|
||||
{
|
||||
if (arg != context.args.begin () &&
|
||||
arg->first != "execute")
|
||||
command_line += arg->first;
|
||||
}
|
||||
|
||||
return system (command_line.c_str ());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue