From 73cf3b01fbd50c3a8a4fd96ff69643c28394d8fe Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 4 Feb 2009 18:23:18 -0400 Subject: Added structural support in main() for using a REPL. --- src/work.cc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/work.cc') diff --git a/src/work.cc b/src/work.cc index a54b1352..9bd75c9c 100644 --- a/src/work.cc +++ b/src/work.cc @@ -97,22 +97,15 @@ void read_environment_settings(report_t& report, char * envp[]) TRACE_FINISH(environment, 1); } -strings_list -read_command_line_arguments(report_t& report, int argc, char * argv[]) +strings_list read_command_arguments(report_t& report, strings_list args) { TRACE_START(arguments, 1, "Processed command-line arguments"); - strings_list args; - process_arguments(argc - 1, argv + 1, report, args); - - if (args.empty()) { - help(std::cout); - throw int(1); - } + strings_list remaining = process_arguments(args, report); TRACE_FINISH(arguments, 1); - return args; + return remaining; } void normalize_session_options(session_t& session) -- cgit v1.2.3