summaryrefslogtreecommitdiff
path: root/src/global.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-10-25 12:52:03 -0700
committerJohn Wiegley <johnw@newartisans.com>2012-10-25 12:52:03 -0700
commit34ca6b3991d63dd04d60286452399c7e0d49974b (patch)
tree09629526f7dd09e9bcaf4a41ed7df8b326c6a1eb /src/global.cc
parentde729114d1be1e6b0bb92c3b5e3f157308c67eae (diff)
parent4b261f99bc56853b3468a8a1bb5b4af39ed67af5 (diff)
downloadfork-ledger-34ca6b3991d63dd04d60286452399c7e0d49974b.tar.gz
fork-ledger-34ca6b3991d63dd04d60286452399c7e0d49974b.tar.bz2
fork-ledger-34ca6b3991d63dd04d60286452399c7e0d49974b.zip
Merge pull request #95 from enderw88/Bug695-init-file
Bug695 init file
Diffstat (limited to 'src/global.cc')
-rw-r--r--src/global.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/global.cc b/src/global.cc
index a718d6cb..3e83ba04 100644
--- a/src/global.cc
+++ b/src/global.cc
@@ -44,6 +44,7 @@
namespace ledger {
static bool args_only = false;
+std::string _init_file;
global_scope_t::global_scope_t(char ** envp)
{
@@ -126,6 +127,8 @@ void global_scope_t::read_init()
}
TRACE_FINISH(init, 1);
+ } else {
+ throw_(parse_error, _f("Could not find specified init file %1%") % init_file);
}
}
}
@@ -473,6 +476,10 @@ void handle_debug_options(int argc, char * argv[])
_log_level = LOG_INFO;
#endif
}
+ else if (i + 1 < argc && std::strcmp(argv[i], "--init-file") == 0) {
+ _init_file = argv[i + 1];
+ i++;
+ }
else if (i + 1 < argc && std::strcmp(argv[i], "--debug") == 0) {
#if DEBUG_ON
_log_level = LOG_DEBUG;