mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 19:17:19 +02:00
A3
- Switched from splitq to Lexer::split for improved arg separation.
This commit is contained in:
parent
8a5d7bb569
commit
b0b176827e
1 changed files with 4 additions and 3 deletions
|
@ -33,6 +33,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <Context.h>
|
#include <Context.h>
|
||||||
|
#include <Lexer.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <Date.h>
|
#include <Date.h>
|
||||||
#include <OldDuration.h>
|
#include <OldDuration.h>
|
||||||
|
@ -161,14 +162,14 @@ void A3::capture (const std::string& arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Prepend a Arg with a blank category.
|
// Prepend an Arg with a blank category.
|
||||||
void A3::capture_first (const std::string& arg)
|
void A3::capture_first (const std::string& arg)
|
||||||
{
|
{
|
||||||
// Break the new argument into parts that comprise a series.
|
// Break the new argument into parts that comprise a series.
|
||||||
std::vector <Arg> series;
|
std::vector <Arg> series;
|
||||||
|
|
||||||
std::vector <std::string> separated;
|
std::vector <std::string> separated;
|
||||||
splitq (separated, arg, ' ');
|
Lexer::split (separated, arg);
|
||||||
std::vector <std::string>::iterator sep;
|
std::vector <std::string>::iterator sep;
|
||||||
for (sep = separated.begin (); sep != separated.end (); ++sep)
|
for (sep = separated.begin (); sep != separated.end (); ++sep)
|
||||||
series.push_back (Arg (*sep));
|
series.push_back (Arg (*sep));
|
||||||
|
@ -344,7 +345,7 @@ void A3::resolve_aliases ()
|
||||||
+ "'");
|
+ "'");
|
||||||
|
|
||||||
std::vector <std::string> words;
|
std::vector <std::string> words;
|
||||||
splitq (words, context.aliases[arg->_raw], ' ');
|
Lexer::split (words, context.aliases[arg->_raw]);
|
||||||
|
|
||||||
std::vector <std::string>::iterator word;
|
std::vector <std::string>::iterator word;
|
||||||
for (word = words.begin (); word != words.end (); ++word)
|
for (word = words.begin (); word != words.end (); ++word)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue