Added --args-only flags, to ignore init and env

This commit is contained in:
John Wiegley 2009-02-16 16:57:32 -04:00
parent d0a664d102
commit 5e1870e259
2 changed files with 10 additions and 4 deletions

View file

@ -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;

View file

@ -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