diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-05 21:18:37 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-05 21:20:09 -0400 |
commit | 408b819c6e087593ba61e82b91dda2369ef32f62 (patch) | |
tree | 68456c86187e00355d47c5794008b8226bd000e2 /src/global.h | |
parent | 7b24e8f8e33049fe533cce2d2d473c6122460954 (diff) | |
download | fork-ledger-408b819c6e087593ba61e82b91dda2369ef32f62.tar.gz fork-ledger-408b819c6e087593ba61e82b91dda2369ef32f62.tar.bz2 fork-ledger-408b819c6e087593ba61e82b91dda2369ef32f62.zip |
Greatly simplified the way option and command handlers are defined.
Diffstat (limited to 'src/global.h')
-rw-r--r-- | src/global.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/global.h b/src/global.h index f47967fb..9b9805a6 100644 --- a/src/global.h +++ b/src/global.h @@ -48,8 +48,6 @@ class global_scope_t : public noncopyable, public scope_t ptr_list<report_t> report_stack; public: - path script_file; - global_scope_t(char ** envp); ~global_scope_t(); @@ -81,7 +79,7 @@ public: void execute_command(strings_list args, bool at_repl); int execute_command_wrapper(strings_list args, bool at_repl); - value_t push_report_cmd(call_scope_t&) { + value_t push_command(call_scope_t&) { // Make a copy at position 2, because the topmost report object has an // open output stream at this point. We want it to get popped off as // soon as this command terminate so that the stream is closed cleanly. @@ -89,19 +87,16 @@ public: new report_t(report_stack.front())); return true; } - value_t pop_report_cmd(call_scope_t&) { + value_t pop_command(call_scope_t&) { pop_report(); return true; } - value_t option_script_(call_scope_t& args) { - script_file = args[0].as_string(); - return true; - } - - value_t ignore(call_scope_t&) { - return true; - } + OPTION(global_scope_t, debug_); + OPTION(global_scope_t, script_); + OPTION(global_scope_t, trace_); + OPTION(global_scope_t, verbose); + OPTION(global_scope_t, verify); virtual expr_t::ptr_op_t lookup(const string& name); }; |