X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fterminal%2Fcommand-line.c;h=39e015050e1fc0731eed7fd86cc0d90eee8575d0;hb=d2a96ae99e49b5264ca68ace469e20fa5e2e605b;hp=f7090a3eb44f18d5086ef8868da7bc7d2f26827e;hpb=2d4dd90964061defa92972156ae2a12323708519;p=pspp diff --git a/src/ui/terminal/command-line.c b/src/ui/terminal/command-line.c index f7090a3eb4..39e015050e 100644 --- a/src/ui/terminal/command-line.c +++ b/src/ui/terminal/command-line.c @@ -1,6 +1,5 @@ /* PSPP - computes sample statistics. Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. - Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -50,11 +49,12 @@ static void usage (void); char *subst_vars (char *); + /* Parses the command line specified by ARGC and ARGV as received by main(). Returns true if normal execution should proceed, false if the command-line indicates that PSPP should exit. */ bool -parse_command_line (int argc, char **argv) +parse_command_line (int argc, char **argv, struct source_stream *ss) { static struct option long_options[] = { @@ -111,7 +111,7 @@ parse_command_line (int argc, char **argv) } break; - case 'x': + case 'x': if ( 0 == strcmp(optarg,"compatible") ) set_syntax(COMPATIBLE); else if ( 0 == strcmp(optarg,"enhanced")) @@ -140,9 +140,9 @@ parse_command_line (int argc, char **argv) break; case 'I': if (optarg == NULL || !strcmp (optarg, "-")) - getl_clear_include_path (); + getl_clear_include_path (ss); else - getl_add_include_dir (optarg); + getl_add_include_dir (ss, optarg); break; case 'l': outp_list_classes (); @@ -192,26 +192,26 @@ parse_command_line (int argc, char **argv) if (process_statrc) { - char *pspprc_fn = fn_search_path ("rc", config_path, NULL); - if (pspprc_fn != NULL) + char *pspprc_fn = fn_search_path ("rc", config_path); + if (pspprc_fn != NULL) { - getl_append_source (create_syntax_file_source (pspprc_fn)); + getl_append_source (ss, create_syntax_file_source (pspprc_fn)); - free (pspprc_fn); + free (pspprc_fn); } } for (i = optind; i < argc; i++) if (strchr (argv[i], '=')) outp_configure_macro (argv[i]); - else + else { - getl_append_source (create_syntax_file_source (argv[i])); + getl_append_source (ss, create_syntax_file_source (argv[i])); syntax_files++; } if (!syntax_files || interactive_mode) - getl_append_source (create_readln_source () ); + getl_append_source (ss, create_readln_source () ); return true; } @@ -231,11 +231,11 @@ N_("PSPP, a program for statistical analysis of sample data.\n" "\nInput and output:\n" " -e, --error-file=FILE send error messages to FILE (appended)\n" " -f, --out-file=FILE send output to FILE (overwritten)\n" -" -p, --pipe read script from stdin, send output to stdout\n" +" -p, --pipe read syntax from stdin, send output to stdout\n" " -I-, --no-include clear include path\n" " -I, --include=DIR append DIR to include path\n" "\nLanguage modifiers:\n" -" -i, --interactive interpret scripts in interactive mode\n" +" -i, --interactive interpret syntax in interactive mode\n" " -n, --edit just check syntax; don't actually run the code\n" " -r, --no-statrc disable execution of .pspp/rc at startup\n" " -s, --safer don't allow some unsafe operations\n"