projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(popup_messages): Always destroy `msg' and `lead' strings, avoiding a
[pspp]
/
src
/
ui
/
terminal
/
command-line.c
diff --git
a/src/ui/terminal/command-line.c
b/src/ui/terminal/command-line.c
index 9eb23d5319f8a021aee53d71d189ff005553efab..95b22cebf8bea93995e87833ed3fec52bf64f044 100644
(file)
--- a/
src/ui/terminal/command-line.c
+++ b/
src/ui/terminal/command-line.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000
, 2007
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-23,7
+23,6
@@
#include <errno.h>
#include <getopt.h>
#include <stdlib.h>
#include <errno.h>
#include <getopt.h>
#include <stdlib.h>
-#include <libpspp/alloc.h>
#include <libpspp/assertion.h>
#include <libpspp/copyleft.h>
#include <libpspp/message.h>
#include <libpspp/assertion.h>
#include <libpspp/copyleft.h>
#include <libpspp/message.h>
@@
-38,16
+37,14
@@
#include <libpspp/verbose-msg.h>
#include "read-line.h"
#include <libpspp/verbose-msg.h>
#include "read-line.h"
+#include "xalloc.h"
+
#include "gettext.h"
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
#include "gettext.h"
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
-void welcome (void);
static void usage (void);
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. */
/* 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. */
@@
-99,9
+96,9
@@
parse_command_line (int argc, char **argv, struct source_stream *ss)
/* Compatibility options */
case 'a':
if ( 0 == strcmp(optarg,"compatible") )
/* Compatibility options */
case 'a':
if ( 0 == strcmp(optarg,"compatible") )
- set_algorithm(COMPATIBLE);
+ set
tings_set
_algorithm(COMPATIBLE);
else if ( 0 == strcmp(optarg,"enhanced"))
else if ( 0 == strcmp(optarg,"enhanced"))
- set_algorithm(ENHANCED);
+ set
tings_set
_algorithm(ENHANCED);
else
{
usage ();
else
{
usage ();
@@
-111,9
+108,9
@@
parse_command_line (int argc, char **argv, struct source_stream *ss)
case 'x':
if ( 0 == strcmp(optarg,"compatible") )
case 'x':
if ( 0 == strcmp(optarg,"compatible") )
- set
_syntax
(COMPATIBLE);
+ set
tings_set_syntax
(COMPATIBLE);
else if ( 0 == strcmp(optarg,"enhanced"))
else if ( 0 == strcmp(optarg,"enhanced"))
- set
_syntax
(ENHANCED);
+ set
tings_set_syntax
(ENHANCED);
else
{
usage ();
else
{
usage ();
@@
-165,7
+162,7
@@
parse_command_line (int argc, char **argv, struct source_stream *ss)
process_statrc = false;
break;
case 's':
process_statrc = false;
break;
case 's':
- set_safer_mode ();
+ set
tings_set
_safer_mode ();
break;
case 'v':
verbose_increment_level ();
break;
case 'v':
verbose_increment_level ();
@@
-175,8
+172,7
@@
parse_command_line (int argc, char **argv, struct source_stream *ss)
puts (legal);
return false;
case 'T':
puts (legal);
return false;
case 'T':
- force_long_view ();
- set_testing_mode (true);
+ settings_set_testing_mode (true);
break;
case '?':
usage ();
break;
case '?':
usage ();
@@
-193,7
+189,11
@@
parse_command_line (int argc, char **argv, struct source_stream *ss)
char *pspprc_fn = fn_search_path ("rc", config_path);
if (pspprc_fn != NULL)
{
char *pspprc_fn = fn_search_path ("rc", config_path);
if (pspprc_fn != NULL)
{
- getl_append_source (ss, create_syntax_file_source (pspprc_fn));
+ getl_append_source (ss,
+ create_syntax_file_source (pspprc_fn),
+ GETL_BATCH,
+ ERRMODE_CONTINUE
+ );
free (pspprc_fn);
}
free (pspprc_fn);
}
@@
-204,12
+204,23
@@
parse_command_line (int argc, char **argv, struct source_stream *ss)
outp_configure_macro (argv[i]);
else
{
outp_configure_macro (argv[i]);
else
{
- getl_append_source (ss, create_syntax_file_source (argv[i]));
+ getl_append_source (ss,
+ create_syntax_file_source (argv[i]),
+ GETL_BATCH,
+ ERRMODE_CONTINUE
+ );
syntax_files++;
}
if (!syntax_files || interactive_mode)
syntax_files++;
}
if (!syntax_files || interactive_mode)
- getl_append_source (ss, create_readln_source () );
+ {
+ getl_append_source (ss, create_readln_source (),
+ GETL_INTERACTIVE,
+ ERRMODE_CONTINUE
+ );
+ if (!cleared_device_defaults)
+ outp_configure_add ("interactive");
+ }
return true;
}
return true;
}