summaryrefslogtreecommitdiff
path: root/src/global.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-06-22 00:29:14 +0100
committerJohn Wiegley <johnw@newartisans.com>2009-06-22 00:29:14 +0100
commitf8c3b4cad8c48be270150c65a2c0a1079e47926f (patch)
treebc010c9fa5f52a5ce6acd2c6ff0896db3b86044f /src/global.cc
parent407d057f4df527b5b1481634ba852155f103d8cf (diff)
downloadfork-ledger-f8c3b4cad8c48be270150c65a2c0a1079e47926f.tar.gz
fork-ledger-f8c3b4cad8c48be270150c65a2c0a1079e47926f.tar.bz2
fork-ledger-f8c3b4cad8c48be270150c65a2c0a1079e47926f.zip
Fixed the --args-only option (sequence problem)
Diffstat (limited to 'src/global.cc')
-rw-r--r--src/global.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/global.cc b/src/global.cc
index c4ed5a8e..e8c6f17d 100644
--- a/src/global.cc
+++ b/src/global.cc
@@ -42,6 +42,8 @@
namespace ledger {
+static bool args_only = false;
+
global_scope_t::global_scope_t(char ** envp)
{
TRACE_CTOR(global_scope_t, "");
@@ -74,7 +76,7 @@ global_scope_t::global_scope_t(char ** envp)
// Before processing command-line options, we must notify the session object
// that such options are beginning, since options like -f cause a complete
// override of files found anywhere else.
- if (! HANDLED(args_only)) {
+ if (! args_only) {
session().set_flush_on_next_data_file(true);
read_environment_settings(envp);
session().set_flush_on_next_data_file(true);
@@ -577,7 +579,10 @@ void handle_debug_options(int argc, char * argv[])
{
for (int i = 1; i < argc; i++) {
if (argv[i][0] == '-') {
- if (std::strcmp(argv[i], "--verify") == 0) {
+ if (std::strcmp(argv[i], "--args-only") == 0) {
+ args_only = true;
+ }
+ else if (std::strcmp(argv[i], "--verify") == 0) {
#if defined(VERIFY_ON)
verify_enabled = true; // global in utils.h
#endif