mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-07 21:07:20 +02:00
Code Cleanup
- Removed obsolete A3::rc_overrides and A3::get_data_location methods.
This commit is contained in:
parent
ebd522dfee
commit
a91101919d
2 changed files with 0 additions and 56 deletions
54
src/A3.cpp
54
src/A3.cpp
|
@ -313,60 +313,6 @@ void A3::append_stdin ()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
void A3::rc_override (
|
|
||||||
std::string& home,
|
|
||||||
File& rc)
|
|
||||||
{
|
|
||||||
// Is there an override for rc:<file>?
|
|
||||||
std::vector <Arg>::iterator arg;
|
|
||||||
for (arg = this->begin (); arg != this->end (); ++arg)
|
|
||||||
{
|
|
||||||
if (arg->_category == Arg::cat_rc)
|
|
||||||
{
|
|
||||||
rc = File (arg->_raw.substr (3));
|
|
||||||
home = rc;
|
|
||||||
|
|
||||||
std::string::size_type last_slash = rc._data.rfind ("/");
|
|
||||||
if (last_slash != std::string::npos)
|
|
||||||
home = rc._data.substr (0, last_slash);
|
|
||||||
else
|
|
||||||
home = ".";
|
|
||||||
|
|
||||||
context.header (format (STRING_A3_ALTERNATE_RC, rc._data));
|
|
||||||
|
|
||||||
// Keep looping, because if there are multiple rc:file arguments, we
|
|
||||||
// want the last one to dominate.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
void A3::get_data_location (std::string& data)
|
|
||||||
{
|
|
||||||
std::string location = context.config.get ("data.location");
|
|
||||||
if (location != "")
|
|
||||||
data = location;
|
|
||||||
|
|
||||||
// Are there any overrides for data.location?
|
|
||||||
std::vector <Arg>::iterator arg;
|
|
||||||
for (arg = this->begin (); arg != this->end (); ++arg)
|
|
||||||
{
|
|
||||||
if (arg->_category == Arg::cat_override)
|
|
||||||
{
|
|
||||||
if (arg->_raw.substr (0, 16) == "rc.data.location" &&
|
|
||||||
(arg->_raw[16] == ':' || arg->_raw[16] == '='))
|
|
||||||
{
|
|
||||||
data = arg->_raw.substr (17);
|
|
||||||
context.header (format (STRING_A3_ALTERNATE_DATA, data));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Keep looping, because if there are multiple overrides, we want the last
|
|
||||||
// one to dominate.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// An alias must be a distinct word on the command line.
|
// An alias must be a distinct word on the command line.
|
||||||
// Aliases may not recurse.
|
// Aliases may not recurse.
|
||||||
|
|
2
src/A3.h
2
src/A3.h
|
@ -51,8 +51,6 @@ public:
|
||||||
static const std::vector <std::string> operator_list ();
|
static const std::vector <std::string> operator_list ();
|
||||||
|
|
||||||
void append_stdin ();
|
void append_stdin ();
|
||||||
void rc_override (std::string&, File&);
|
|
||||||
void get_data_location (std::string&);
|
|
||||||
void resolve_aliases ();
|
void resolve_aliases ();
|
||||||
void apply_overrides ();
|
void apply_overrides ();
|
||||||
void inject_defaults ();
|
void inject_defaults ();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue