mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-24 18:06:42 +02:00
Feature #1026
- Feature #1026, command line overrides are now applied before and after the creation of the default rc file and data directory, which allows for programmatic initialization without keystroke synthesis (thanks to Nicholas Rabenau).
This commit is contained in:
parent
b702251431
commit
88fcdab515
2 changed files with 15 additions and 5 deletions
|
@ -32,6 +32,10 @@ Features
|
|||
with 'dateformat.info'.
|
||||
+ Bash script improvement (column names are now completed).
|
||||
+ Feature #1013, output error, header, footnote and debug messages on standard error.
|
||||
+ Feature #1026, command line overrides are now applied before and after the
|
||||
creation of the default rc file and data directory, which allows for
|
||||
programmatic initialization without keystroke synthesis (thanks to Nicholas
|
||||
Rabenau).
|
||||
+ Color error messages with a specific configuration variable 'color.error'.
|
||||
|
||||
Bugs
|
||||
|
|
|
@ -131,6 +131,7 @@ int Context::initialize (int argc, const char** argv)
|
|||
*/
|
||||
|
||||
// Create missing config file and data directory, if necessary.
|
||||
a3.apply_overrides ();
|
||||
createDefaultConfig ();
|
||||
|
||||
// Handle Aliases.
|
||||
|
@ -596,7 +597,8 @@ void Context::createDefaultConfig ()
|
|||
// Do we need to create a default rc?
|
||||
if (! rc_file.exists ())
|
||||
{
|
||||
if (!confirm (format (STRING_CONTEXT_CREATE_RC, home_dir, rc_file._data)))
|
||||
if (config.getBoolean ("confirmation") &&
|
||||
!confirm (format (STRING_CONTEXT_CREATE_RC, home_dir, rc_file._data)))
|
||||
throw std::string (STRING_CONTEXT_NEED_RC);
|
||||
|
||||
config.createDefaultRC (rc_file, data_dir);
|
||||
|
@ -710,28 +712,32 @@ void Context::updateVerbosity ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Context::header (const std::string& input)
|
||||
{
|
||||
if (input.length ())
|
||||
if (input.length () &&
|
||||
std::find (headers.begin (), headers.end (), input) == headers.end ())
|
||||
headers.push_back (input);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Context::footnote (const std::string& input)
|
||||
{
|
||||
if (input.length ())
|
||||
if (input.length () &&
|
||||
std::find (footnotes.begin (), footnotes.end (), input) == footnotes.end ())
|
||||
footnotes.push_back (input);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Context::error (const std::string& input)
|
||||
{
|
||||
if (input.length ())
|
||||
if (input.length () &&
|
||||
std::find (errors.begin (), errors.end (), input) == errors.end ())
|
||||
errors.push_back (input);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Context::debug (const std::string& input)
|
||||
{
|
||||
if (input.length ())
|
||||
if (input.length () &&
|
||||
std::find (debugMessages.begin (), debugMessages.end (), input) == debugMessages.end ())
|
||||
debugMessages.push_back (input);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue