From 57bd08efce33ee505cdbef56a3bb9bd93bedb7ba Mon Sep 17 00:00:00 2001 From: thdox Date: Wed, 25 Feb 2015 20:05:56 +0100 Subject: [PATCH 1/5] Add --revalued-total to "to be tested" options. I have not yet understood the meaning of --revalued-total, but as it output something, it should be tested. So add it to "to be tested" options list. --- test/CheckBaselineTests.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/CheckBaselineTests.py b/test/CheckBaselineTests.py index 1439cda4..2a1f0315 100755 --- a/test/CheckBaselineTests.py +++ b/test/CheckBaselineTests.py @@ -32,7 +32,6 @@ class CheckBaselineTests (CheckOptions): 'no-pager', 'options', 'price-exp', - 'revalued-total', 'seed', 'trace', 'verbose', From 2bcfb0df5a56bb8f6f16078e6b0fa7c4c8b2f385 Mon Sep 17 00:00:00 2001 From: thdox Date: Wed, 25 Feb 2015 20:15:00 +0100 Subject: [PATCH 2/5] Add --verify-memory to untested options. This --verify-memory option is very system (Linux/Mac) dependent on how the memory is allocated. This cannot be reproduce with same results. --- test/CheckBaselineTests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/CheckBaselineTests.py b/test/CheckBaselineTests.py index 2a1f0315..9c8d4123 100755 --- a/test/CheckBaselineTests.py +++ b/test/CheckBaselineTests.py @@ -36,6 +36,7 @@ class CheckBaselineTests (CheckOptions): 'trace', 'verbose', 'verify', + 'verify-memory', 'version' ] From befb06f941d4f4573c3624071bd680caf292edfa Mon Sep 17 00:00:00 2001 From: thdox Date: Wed, 25 Feb 2015 20:22:41 +0100 Subject: [PATCH 3/5] Add --generated to untested options list. --generated will generate each time new entries, this cannot be reproduced safely. --- test/CheckBaselineTests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/CheckBaselineTests.py b/test/CheckBaselineTests.py index 9c8d4123..f0eb2646 100755 --- a/test/CheckBaselineTests.py +++ b/test/CheckBaselineTests.py @@ -26,6 +26,7 @@ class CheckBaselineTests (CheckOptions): 'file', 'force-color', 'force-pager', + 'generated', 'help', 'import', 'no-color', From de7d8466c03728004b4c06983b795faf593cbe59 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Thu, 23 Apr 2015 15:36:35 -0400 Subject: [PATCH 4/5] Fix description of --unrealized-losses --- doc/ledger.1 | 2 +- doc/ledger3.texi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ledger.1 b/doc/ledger.1 index f4ee9625..b674cb6a 100644 --- a/doc/ledger.1 +++ b/doc/ledger.1 @@ -960,7 +960,7 @@ Often set in one's file to change the default. .It Fl \-unrealized-losses Allow the user to specify what account name should be used for -unrealized gains. Defaults to +unrealized losses. Defaults to .Sy "Equity:Unrealized Losses" . Often set in one's .Pa ~/.ledgerrc diff --git a/doc/ledger3.texi b/doc/ledger3.texi index bbb8e515..441b15d1 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -6752,7 +6752,7 @@ Often set in one's @file{~/.ledgerrc} file to change the default. @item --unrealized-losses @var{STR} Allow the user to specify what account name should be used for -unrealized gains. Defaults to @samp{"Equity:Unrealized Losses"}. +unrealized losses. Defaults to @samp{"Equity:Unrealized Losses"}. Often set in one's @file{~/.ledgerrc} file to change the default. @item --unround From 6439ea4799c1ad7c3a9ccd0d2cd0f2cef55f400c Mon Sep 17 00:00:00 2001 From: David Sklar Date: Mon, 27 Apr 2015 10:12:14 -0400 Subject: [PATCH 5/5] Use ./.ledgerrc if ~/.ledgerrc doesn't exist --- src/global.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/global.cc b/src/global.cc index bdaabd5a..e4ebe6f5 100644 --- a/src/global.cc +++ b/src/global.cc @@ -110,7 +110,7 @@ global_scope_t::~global_scope_t() void global_scope_t::parse_init(path init_file) { TRACE_START(init, 1, "Read initialization file"); - + parse_context_stack_t parsing_context; parsing_context.push(init_file); parsing_context.get_current().journal = session().journal.get(); @@ -122,13 +122,13 @@ void global_scope_t::parse_init(path init_file) throw_(parse_error, _f("Transactions found in initialization file '%1%'") % init_file); } - + TRACE_FINISH(init, 1); } void global_scope_t::read_init() { - // if specified on the command line init_file_ is filled in + // if specified on the command line init_file_ is filled in // global_scope_t::handle_debug_options. If it was specified on the command line // fail if the file doesn't exist. If no init file was specified // on the command-line then try the default values, but don't fail if there @@ -144,6 +144,9 @@ void global_scope_t::read_init() } else { if (const char * home_var = std::getenv("HOME")) { init_file = (path(home_var) / ".ledgerrc"); + if (! exists(init_file)) { + init_file = ("./.ledgerrc"); + } } else { init_file = ("./.ledgerrc"); } @@ -499,7 +502,7 @@ void handle_debug_options(int argc, char * argv[]) } else if (i + 1 < argc && std::strcmp(argv[i], "--debug") == 0) { #if DEBUG_ON - _log_level = LOG_DEBUG; + _log_level = LOG_DEBUG; _log_category = argv[i + 1]; i++; #endif