summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Feigl <craven@gmx.net>2014-02-26 23:50:50 +0100
committerPeter Feigl <craven@gmx.net>2014-02-26 23:50:50 +0100
commitecd5097d515f53703eb5dc6096da80182c452ad9 (patch)
treef5d912e3e87c6e0e72bf6cd8bea758a0ae42ed03 /src
parentee36a33a19c57cd57c1be7076530d65ae1ac68b0 (diff)
downloadfork-ledger-ecd5097d515f53703eb5dc6096da80182c452ad9.tar.gz
fork-ledger-ecd5097d515f53703eb5dc6096da80182c452ad9.tar.bz2
fork-ledger-ecd5097d515f53703eb5dc6096da80182c452ad9.zip
Adding option --no-aliases to completely disable alias expansion
Diffstat (limited to 'src')
-rw-r--r--src/journal.cc3
-rw-r--r--src/journal.h1
-rw-r--r--src/session.cc5
-rw-r--r--src/session.h2
4 files changed, 11 insertions, 0 deletions
diff --git a/src/journal.cc b/src/journal.cc
index 007acd7b..160abe06 100644
--- a/src/journal.cc
+++ b/src/journal.cc
@@ -173,6 +173,9 @@ account_t * journal_t::expand_aliases(string name) {
// prevent infinite excursion. Each alias may only be expanded at most once.
account_t * result = NULL;
+ if(no_aliases)
+ return result;
+
bool keep_expanding = true;
std::list<string> already_seen;
// loop until no expansion can be found
diff --git a/src/journal.h b/src/journal.h
index 270a2912..e4763482 100644
--- a/src/journal.h
+++ b/src/journal.h
@@ -132,6 +132,7 @@ public:
bool check_payees;
bool day_break;
bool recursive_aliases;
+ bool no_aliases;
payee_mappings_t payee_mappings;
account_mappings_t account_mappings;
accounts_map account_aliases;
diff --git a/src/session.cc b/src/session.cc
index 99467a43..b386607a 100644
--- a/src/session.cc
+++ b/src/session.cc
@@ -115,6 +115,8 @@ std::size_t session_t::read_data(const string& master_account)
if (HANDLED(recursive_aliases))
journal->recursive_aliases = true;
+ if (HANDLED(no_aliases))
+ journal->no_aliases = true;
if (HANDLED(permissive))
journal->checking_style = journal_t::CHECK_PERMISSIVE;
@@ -347,6 +349,9 @@ option_t<session_t> * session_t::lookup_option(const char * p)
case 'm':
OPT(master_account_);
break;
+ case 'n':
+ OPT(no_aliases);
+ break;
case 'p':
OPT(price_db_);
else OPT(price_exp_);
diff --git a/src/session.h b/src/session.h
index c2345362..d20ba74a 100644
--- a/src/session.h
+++ b/src/session.h
@@ -110,6 +110,7 @@ public:
HANDLER(price_db_).report(out);
HANDLER(price_exp_).report(out);
HANDLER(recursive_aliases).report(out);
+ HANDLER(no_aliases).report(out);
HANDLER(strict).report(out);
HANDLER(value_expr_).report(out);
}
@@ -166,6 +167,7 @@ public:
OPTION(session_t, strict);
OPTION(session_t, value_expr_);
OPTION(session_t, recursive_aliases);
+ OPTION(session_t, no_aliases);
};
/**