mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
A3t
- Renamed methods for consistency.
This commit is contained in:
parent
26fb3c1686
commit
b690a8d2a3
5 changed files with 22 additions and 22 deletions
16
src/A3t.cpp
16
src/A3t.cpp
|
@ -81,7 +81,7 @@ void A3t::initialize (int argc, const char** argv)
|
|||
//
|
||||
// echo one two -- three | task zero --> task zero one two
|
||||
// 'three' is left in the input buffer.
|
||||
void A3t::append_stdin ()
|
||||
void A3t::appendStdin ()
|
||||
{
|
||||
#ifdef FEATURE_STDIN
|
||||
// Use 'select' to determine whether there is any std::cin content buffered
|
||||
|
@ -333,7 +333,7 @@ void A3t::findOverrides ()
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Look for RC and return file as a File.
|
||||
void A3t::get_overrides (
|
||||
void A3t::getOverrides (
|
||||
std::string& home,
|
||||
File& rc)
|
||||
{
|
||||
|
@ -361,7 +361,7 @@ void A3t::get_overrides (
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Look for CONFIG data.location and return value as a Path.
|
||||
void A3t::get_data_location (Path& data)
|
||||
void A3t::getDataLocation (Path& data)
|
||||
{
|
||||
std::string location = context.config.get ("data.location");
|
||||
if (location != "")
|
||||
|
@ -385,7 +385,7 @@ void A3t::get_data_location (Path& data)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Takes all CONFIG name/value pairs and overrides configuration.
|
||||
// leaving only the plain args.
|
||||
void A3t::apply_overrides ()
|
||||
void A3t::applyOverrides ()
|
||||
{
|
||||
std::vector <Tree*>::iterator i;
|
||||
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
|
||||
|
@ -401,7 +401,7 @@ void A3t::apply_overrides ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void A3t::inject_defaults ()
|
||||
void A3t::injectDefaults ()
|
||||
{
|
||||
//std::cout << "#####################\n";
|
||||
//std::cout << _tree->dump ();
|
||||
|
@ -444,7 +444,7 @@ void A3t::inject_defaults ()
|
|||
{
|
||||
//std::cout << "# default_command\n";
|
||||
context.debug ("No command or sequence found - assuming default.command.");
|
||||
Tree* t = capture_first (defaultCommand);
|
||||
Tree* t = captureFirst (defaultCommand);
|
||||
t->tag ("DEFAULT");
|
||||
|
||||
std::string combined;
|
||||
|
@ -477,7 +477,7 @@ void A3t::inject_defaults ()
|
|||
|
||||
context.debug ("Sequence but no command found - assuming 'information' command.");
|
||||
context.header (STRING_ASSUME_INFO);
|
||||
Tree* t = capture_first ("information");
|
||||
Tree* t = captureFirst ("information");
|
||||
t->tag ("ASSUMED");
|
||||
}
|
||||
}
|
||||
|
@ -490,7 +490,7 @@ void A3t::inject_defaults ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Tree* A3t::capture_first (const std::string& arg)
|
||||
Tree* A3t::captureFirst (const std::string& arg)
|
||||
{
|
||||
// Insert the arg as the new first branch.
|
||||
Tree* t = new Tree ("argIns");
|
||||
|
|
12
src/A3t.h
12
src/A3t.h
|
@ -38,7 +38,7 @@ public:
|
|||
A3t ();
|
||||
~A3t ();
|
||||
void initialize (int, const char**);
|
||||
void append_stdin ();
|
||||
void appendStdin ();
|
||||
Tree* tree ();
|
||||
Tree* parse ();
|
||||
void entity (const std::string&, const std::string&);
|
||||
|
@ -50,11 +50,11 @@ public:
|
|||
void findIdSequence ();
|
||||
void findUUIDList ();
|
||||
|
||||
void get_overrides (std::string&, File&);
|
||||
void get_data_location (Path&);
|
||||
void apply_overrides ();
|
||||
void inject_defaults ();
|
||||
Tree* capture_first (const std::string&);
|
||||
void getOverrides (std::string&, File&);
|
||||
void getDataLocation (Path&);
|
||||
void applyOverrides ();
|
||||
void injectDefaults ();
|
||||
Tree* captureFirst (const std::string&);
|
||||
|
||||
private:
|
||||
void findTerminator ();
|
||||
|
|
|
@ -109,13 +109,13 @@ int Context::initialize (int argc, const char** argv)
|
|||
// echo one two -- three | task zero --> task zero one two
|
||||
// 'three' is left in the input buffer.
|
||||
a3.append_stdin ();
|
||||
a3t.append_stdin (); // echo stdin0 | task ...
|
||||
a3t.appendStdin (); // echo stdin0 | task ...
|
||||
|
||||
// Process 'rc:<file>' command line override, and remove the argument from the
|
||||
// Context::a3.
|
||||
a3.categorize ();
|
||||
a3t.findOverrides (); // rc:<file> rc.<name>:<value>
|
||||
a3t.get_overrides (home_dir, rc_file); // <-- <file>
|
||||
a3t.getOverrides (home_dir, rc_file); // <-- <file>
|
||||
|
||||
// TASKRC environment variable overrides the command line.
|
||||
char* override = getenv ("TASKRC");
|
||||
|
@ -132,7 +132,7 @@ int Context::initialize (int argc, const char** argv)
|
|||
// The data location, Context::data_dir, is determined from the assumed
|
||||
// location (~/.task), or set by data.location in the config file, or
|
||||
// overridden by rc.data.location on the command line.
|
||||
a3t.get_data_location (data_dir); // <-- rc.data.location=<location>
|
||||
a3t.getDataLocation (data_dir); // <-- rc.data.location=<location>
|
||||
|
||||
override = getenv ("TASKDATA");
|
||||
if (override)
|
||||
|
@ -144,7 +144,7 @@ int Context::initialize (int argc, const char** argv)
|
|||
|
||||
// Create missing config file and data directory, if necessary.
|
||||
a3.apply_overrides ();
|
||||
a3t.apply_overrides ();
|
||||
a3t.applyOverrides ();
|
||||
createDefaultConfig ();
|
||||
|
||||
// Handle Aliases.
|
||||
|
@ -199,7 +199,7 @@ int Context::initialize (int argc, const char** argv)
|
|||
a3t.findCommand (); // <cmd>
|
||||
a3t.findUUIDList (); // <uuid> Before findIdSequence
|
||||
a3t.findIdSequence (); // <id>
|
||||
a3t.inject_defaults (); // rc.default.command
|
||||
a3t.injectDefaults (); // rc.default.command
|
||||
|
||||
// Static initialization to decouple code.
|
||||
staticInitialization ();
|
||||
|
|
|
@ -37,7 +37,7 @@ int main (int argc, const char** argv)
|
|||
{
|
||||
A3t a3t;
|
||||
a3t.initialize (argc, argv);
|
||||
a3t.append_stdin ();
|
||||
a3t.appendStdin ();
|
||||
a3t.findOverrides ();
|
||||
|
||||
Alias alias;
|
||||
|
@ -150,7 +150,7 @@ int main (int argc, const char** argv)
|
|||
a3t.findCommand ();
|
||||
a3t.findUUIDList ();
|
||||
a3t.findIdSequence ();
|
||||
a3t.inject_defaults ();
|
||||
a3t.injectDefaults ();
|
||||
|
||||
Tree* tree = a3t.parse ();
|
||||
if (tree)
|
||||
|
|
|
@ -89,7 +89,7 @@ int CmdCustom::execute (std::string& output)
|
|||
{
|
||||
context.a3.capture_first (*arg);
|
||||
|
||||
Tree* t = context.a3t.capture_first (*arg);
|
||||
Tree* t = context.a3t.captureFirst (*arg);
|
||||
t->tag ("CUSTOM");
|
||||
t->tag ("FILTER");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue