diff --git a/src/main.cc b/src/main.cc index 207582e2..061d6b2d 100644 --- a/src/main.cc +++ b/src/main.cc @@ -44,8 +44,12 @@ namespace { public: path script_file; - global_scope_t() { + global_scope_t(char ** envp) + { + TRACE_CTOR(global_scope_t, ""); + session_ptr.reset(new LEDGER_SESSION_T); + set_session_context(session_ptr.get()); // Create the report object, which maintains state relating to each @@ -54,21 +58,45 @@ namespace { // a GUI were calling into Ledger it would have one session object per // open document, with a separate report_t object for each report it // generated. - report_stack.push_front(new report_t(*session_ptr.get())); + report_stack.push_front(new report_t(session())); + + // Read the user's options, in the following order: + // + // 1. environment variables (LEDGER_