diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-16 16:57:32 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-16 16:57:32 -0400 |
commit | 5e1870e259e866f3720bddbf757dec0c781cc967 (patch) | |
tree | 34d70e9172890a956a332831537da773a2442f15 | |
parent | d0a664d102bb0886dbaf844b6857749f70702ea3 (diff) | |
download | fork-ledger-5e1870e259e866f3720bddbf757dec0c781cc967.tar.gz fork-ledger-5e1870e259e866f3720bddbf757dec0c781cc967.tar.bz2 fork-ledger-5e1870e259e866f3720bddbf757dec0c781cc967.zip |
Added --args-only flags, to ignore init and env
-rw-r--r-- | src/global.cc | 13 | ||||
-rw-r--r-- | src/global.h | 1 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/global.cc b/src/global.cc index 598aee48..c2a86569 100644 --- a/src/global.cc +++ b/src/global.cc @@ -67,10 +67,12 @@ 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. - session().set_flush_on_next_data_file(true); - read_environment_settings(envp); - session().set_flush_on_next_data_file(true); - read_init(); + if (! HANDLED(args_only)) { + session().set_flush_on_next_data_file(true); + read_environment_settings(envp); + session().set_flush_on_next_data_file(true); + read_init(); + } } global_scope_t::~global_scope_t() @@ -231,6 +233,9 @@ int global_scope_t::execute_command_wrapper(strings_list args, bool at_repl) option_t<global_scope_t> * global_scope_t::lookup_option(const char * p) { switch (*p) { + case 'a': + OPT(args_only); + break; case 'd': OPT(debug_); break; diff --git a/src/global.h b/src/global.h index 883972fc..1fb3e157 100644 --- a/src/global.h +++ b/src/global.h @@ -112,6 +112,7 @@ See LICENSE file included with the distribution for details and disclaimer."; virtual expr_t::ptr_op_t lookup(const string& name); + OPTION(global_scope_t, args_only); OPTION(global_scope_t, debug_); OPTION(global_scope_t, full_help); // -H |