mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Argument Parsing
- Eliminated stored arg_overrides and file_override in Context. - Removed Filter, Subst, Task, Sequence from Context. - Remove shadow file support. Hallelujah. - Disabled/commented out most commands, ready for the big transition to the new parsing style. - Obsoleted Subst.{h,cpp}.
This commit is contained in:
parent
b4c1e47ab4
commit
58a677ffb5
42 changed files with 265 additions and 383 deletions
|
@ -224,8 +224,7 @@ void Arguments::categorize ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Arguments::rc_override (
|
||||
std::string& home,
|
||||
File& rc,
|
||||
std::string& override)
|
||||
File& rc)
|
||||
{
|
||||
// Is there an override for rc:<file>?
|
||||
std::vector <std::pair <std::string, std::string> >::iterator arg;
|
||||
|
@ -233,7 +232,6 @@ void Arguments::rc_override (
|
|||
{
|
||||
if (arg->second == "rc")
|
||||
{
|
||||
override = arg->first;
|
||||
rc = File (arg->first.substr (3));
|
||||
home = rc;
|
||||
|
||||
|
@ -280,7 +278,7 @@ void Arguments::get_data_location (std::string& data)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Extracts any rc.name:value args and sets the name/value in context.config,
|
||||
// leaving only the plain args.
|
||||
void Arguments::apply_overrides (std::string& var_overrides)
|
||||
void Arguments::apply_overrides ()
|
||||
{
|
||||
std::vector <std::pair <std::string, std::string> >::iterator arg;
|
||||
for (arg = this->begin (); arg != this->end (); ++arg)
|
||||
|
@ -294,13 +292,10 @@ void Arguments::apply_overrides (std::string& var_overrides)
|
|||
n.getUntilOneOf (":=", name) && // xxx
|
||||
n.skipN (1)) // :
|
||||
{
|
||||
n.getUntilEOS (value); // Don't care if it's blank.
|
||||
n.getUntilEOS (value); // May be blank.
|
||||
|
||||
context.config.set (name, value);
|
||||
context.footnote ("Configuration override rc." + name + "=" + value);
|
||||
|
||||
// Overrides are retained for potential use by the default command.
|
||||
var_overrides += " " + arg->first;
|
||||
}
|
||||
else
|
||||
context.footnote ("Problem with override: " + arg->first);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue