Merge branch 'master' of ssh://jmd@git.sv.gnu.org/srv/git/pspp
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 8 Nov 2008 03:50:39 +0000 (12:50 +0900)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 8 Nov 2008 03:50:39 +0000 (12:50 +0900)
17 files changed:
Smake
doc/invoking.texi
po/en_GB.po
src/ui/automake.mk
src/ui/command-line.c [new file with mode: 0644]
src/ui/command-line.h [new file with mode: 0644]
src/ui/gui/main.c
src/ui/gui/psppire.c
src/ui/gui/psppire.h
src/ui/source-init-opts.c [new file with mode: 0644]
src/ui/source-init-opts.h [new file with mode: 0644]
src/ui/terminal/automake.mk
src/ui/terminal/command-line.c [deleted file]
src/ui/terminal/command-line.h [deleted file]
src/ui/terminal/main.c
src/ui/terminal/terminal-opts.c [new file with mode: 0644]
src/ui/terminal/terminal-opts.h [new file with mode: 0644]

diff --git a/Smake b/Smake
index 3994a302b650b7d5c5f89a10db484b010adc1aa1..7905c430fe28401c4e5f454a0e4c3218d3a8f283 100644 (file)
--- a/Smake
+++ b/Smake
@@ -5,6 +5,7 @@ GNULIB = ../gnulib
 GNULIB_TOOL = $(GNULIB)/gnulib-tool
 
 GNULIB_MODULES = \
+       argp \
        assert \
        byteswap \
        c-ctype \
index b5f157e6656e4c96af00bda27437ef1a95e70b5a..d761935861c545f11d2fd9228d27d18fa2548b5b 100644 (file)
@@ -7,12 +7,12 @@
 @cindex options, command-line
 @example
 pspp [ -B @var{dir} | --config-dir=@var{dir} ] [ -o @var{device} | --device=@var{device} ]
-       [ -d @var{var}[=@var{value}] | --define=@var{var}[=@var{value}] ] [-u @var{var} | --undef=@var{var} ]
-       [ -f @var{file} | --out-file=@var{file} ] [ -p | --pipe ] [ -I- | --no-include ]
+       [ -a @{compatible|enhanced@} | --algorithm=@{compatible|enhanced@}]
+       [ -x @{compatible|enhanced@} | --syntax=@{compatible|enhanced@}]
+       [ -I- | --no-include ]
        [ -I @var{dir} | --include=@var{dir} ] [ -i | --interactive ] 
-       [ -n | --edit | --dry-run | --just-print | --recon ] 
        [ -r | --no-statrc ] [ -h | --help ] [ -l | --list ] 
-       [ -c @var{command} | --command @var{command} ] [ -s | --safer ]
+       [ -s | --safer ]
        [ --testing-mode ] [ -V | --version ] [ -v | --verbose ] 
        [ @var{key}=@var{value} ] @var{file}@enddots{}
 @end example
@@ -101,19 +101,6 @@ Input and output options affect how PSPP reads input and writes
 output.  These are the input and output options:
 
 @table @code
-@item -f @var{file}
-@itemx --out-file=@var{file}
-
-This overrides the output file name for devices designated as listing
-devices.  If a file named @var{file} already exists, it is overwritten.
-
-@item -p
-@itemx --pipe
-
-Allows PSPP to be used as a filter by causing the syntax file to be
-read from stdin and output to be written to stdout.  Conflicts with the
-@code{-f @var{file}} and @code{--file=@var{file}} options.
-
 @item -I-
 @itemx --no-include
 
@@ -127,12 +114,6 @@ configuring}.
 Appends directory @var{dir} to the path that is searched for include
 files in PSPP syntax files.
 
-@item -c @var{command}
-@itemx --command=@var{command}
-
-Execute literal command @var{command}.  The command is executed before
-startup syntax files, if any.
-
 @item --testing-mode
 
 Invoke heuristics to assist with testing PSPP.  For use by @code{make
@@ -158,16 +139,6 @@ mode, rather than the default batch mode.  @xref{Tokenizing lines}, for
 information on the differences between batch mode and interactive mode
 command interpretation.
 
-@item -n
-@itemx --edit
-@itemx --dry-run
-@itemx --just-print
-@itemx --recon
-
-Only the syntax of any syntax file specified or of commands entered at
-the command line is checked.  Transformations are not performed and
-procedures are not executed.  Not yet implemented.
-
 @item -r
 @itemx --no-statrc
 
index 0c13bd309b921cd8ce518e6ec58932fb1963d7d1..6c45380aad836b4d1f801063ca8c434ccf86ba5b 100644 (file)
@@ -1,14 +1,13 @@
 # British translations for PSPP
-# Copyright (C) 2007 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
 # This file is distributed under the same licence as the PSPP package.
-# John Darrington <john@darrington.wattle.id.au>, 2007.
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: PSPP 0.4.3\n"
+"Project-Id-Version: PSPP 0.7.0\n"
 "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2008-09-08 18:04+0800\n"
-"PO-Revision-Date: 2007-09-15 08:29+0800\n"
+"POT-Creation-Date: 2008-11-05 08:02+0900\n"
+"PO-Revision-Date: 2008-11-05 08:17+0900\n"
 "Last-Translator: John Darrington <john@darrington.wattle.id.au>\n"
 "Language-Team: John Darrington <john@darrington.wattle.id.au>\n"
 "MIME-Version: 1.0\n"
@@ -101,7 +100,7 @@ msgstr ""
 
 #: src/data/data-in.c:338
 msgid "Unrecognized character in field."
-msgstr ""
+msgstr "Unrecognised character in field."
 
 #: src/data/data-in.c:362 src/data/data-in.c:636
 msgid "Field must have even length."
@@ -129,6 +128,8 @@ msgid ""
 "Unrecognized month format.  Months may be specified as Arabic or Roman "
 "numerals or as at least 3 letters of their English names."
 msgstr ""
+"Unrecognised month format.  Months may be specified as Arabic or Roman \n"
+"numerals or as at least 3 letters of their English names."
 
 #: src/data/data-in.c:850
 #, c-format
@@ -173,6 +174,8 @@ msgid ""
 "Unrecognized weekday name.  At least the first two letters of an English "
 "weekday name must be specified."
 msgstr ""
+"Unrecognised weekday name.  At least the first two letters of an English \n"
+"weekday name must be specified.\n"
 
 #: src/data/data-in.c:1138
 #, c-format
@@ -216,13 +219,13 @@ msgstr ""
 msgid "scratch"
 msgstr ""
 
-#: src/data/dictionary.c:882
+#: src/data/dictionary.c:889
 msgid ""
 "At least one case in the data file had a weight value that was user-missing, "
 "system-missing, zero, or negative.  These case(s) were ignored."
 msgstr ""
 
-#: src/data/dictionary.c:1180
+#: src/data/dictionary.c:1187
 #, c-format
 msgid "Truncating document line to %d bytes."
 msgstr ""
@@ -319,33 +322,33 @@ msgstr[1] ""
 msgid "%s variables are not compatible with %s format %s."
 msgstr ""
 
-#: src/data/format.c:327 src/data/sys-file-reader.c:639
+#: src/data/format.c:327 src/data/sys-file-reader.c:655
 #: src/ui/gui/data-editor.glade:1190 src/ui/gui/psppire.glade:2176
 #: src/ui/gui/psppire-var-store.c:605
 msgid "String"
 msgstr ""
 
-#: src/data/format.c:327 src/data/sys-file-reader.c:639
+#: src/data/format.c:327 src/data/sys-file-reader.c:655
 #: src/ui/gui/data-editor.glade:1079 src/ui/gui/psppire.glade:2131
 #: src/ui/gui/psppire-var-store.c:598
 msgid "Numeric"
 msgstr ""
 
-#: src/data/format.c:328 src/data/sys-file-reader.c:1145
-#: src/data/sys-file-reader.c:1147
+#: src/data/format.c:328 src/data/sys-file-reader.c:1160
+#: src/data/sys-file-reader.c:1162
 #: src/language/dictionary/apply-dictionary.c:78
 #: src/language/dictionary/apply-dictionary.c:79
-#: src/language/xforms/recode.c:472 src/language/xforms/recode.c:473
-#: src/language/xforms/recode.c:485 src/language/xforms/recode.c:486
+#: src/language/xforms/recode.c:489 src/language/xforms/recode.c:490
+#: src/language/xforms/recode.c:502 src/language/xforms/recode.c:503
 msgid "numeric"
 msgstr ""
 
-#: src/data/format.c:328 src/data/sys-file-reader.c:1145
-#: src/data/sys-file-reader.c:1147
+#: src/data/format.c:328 src/data/sys-file-reader.c:1160
+#: src/data/sys-file-reader.c:1162
 #: src/language/dictionary/apply-dictionary.c:78
 #: src/language/dictionary/apply-dictionary.c:79
-#: src/language/xforms/recode.c:472 src/language/xforms/recode.c:473
-#: src/language/xforms/recode.c:485 src/language/xforms/recode.c:486
+#: src/language/xforms/recode.c:489 src/language/xforms/recode.c:490
+#: src/language/xforms/recode.c:502 src/language/xforms/recode.c:503
 msgid "string"
 msgstr ""
 
@@ -484,7 +487,7 @@ msgstr ""
 #: src/data/por-file-reader.c:519
 #, c-format
 msgid "Unrecognized version code `%c'."
-msgstr ""
+msgstr "Unrecognised version code `%c'."
 
 #: src/data/por-file-reader.c:528
 #, c-format
@@ -639,7 +642,7 @@ msgstr ""
 msgid "scratch file"
 msgstr ""
 
-#: src/data/settings.c:685
+#: src/data/settings.c:687
 #, c-format
 msgid ""
 "%s: Custom currency string `%s' does not contain exactly three periods or "
@@ -652,352 +655,364 @@ msgstr ""
 
 #. TRANSLATORS: this fragment will be interpolated into
 #. messages in fh_lock() that identify types of files.
-#: src/data/sys-file-reader.c:198 src/data/sys-file-writer.c:190
+#: src/data/sys-file-reader.c:214 src/data/sys-file-writer.c:196
 msgid "system file"
 msgstr ""
 
-#: src/data/sys-file-reader.c:205
+#: src/data/sys-file-reader.c:221
 #, c-format
 msgid "Error opening \"%s\" for reading as a system file: %s."
 msgstr ""
 
-#: src/data/sys-file-reader.c:244
+#: src/data/sys-file-reader.c:260
 msgid "Misplaced type 4 record."
 msgstr ""
 
-#: src/data/sys-file-reader.c:255
+#: src/data/sys-file-reader.c:271
 #, c-format
 msgid "Unrecognized record type %d."
-msgstr ""
+msgstr "Unrecognised record type %d."
 
-#: src/data/sys-file-reader.c:294
+#: src/data/sys-file-reader.c:310
 #, c-format
 msgid "File header claims %d variable positions but %d were read from file."
 msgstr ""
 
-#: src/data/sys-file-reader.c:334
+#: src/data/sys-file-reader.c:350
 #, c-format
 msgid "Error closing system file \"%s\": %s."
 msgstr ""
 
-#: src/data/sys-file-reader.c:399 src/data/sys-file-reader.c:409
+#: src/data/sys-file-reader.c:415 src/data/sys-file-reader.c:425
 msgid "This is not an SPSS system file."
 msgstr ""
 
-#: src/data/sys-file-reader.c:428
+#: src/data/sys-file-reader.c:444
 msgid ""
 "Compression bias is not the usual value of 100, or system file uses "
 "unrecognized floating-point format."
 msgstr ""
+"Compression bias is not the usual value of 100, or system file uses \n"
+"unrecognised floating-point format."
 
-#: src/data/sys-file-reader.c:496
+#: src/data/sys-file-reader.c:512
 #, c-format
 msgid "Invalid variable name `%s'."
 msgstr ""
 
-#: src/data/sys-file-reader.c:500
+#: src/data/sys-file-reader.c:516
 #, c-format
 msgid "Bad variable width %d."
 msgstr ""
 
-#: src/data/sys-file-reader.c:504
+#: src/data/sys-file-reader.c:520
 #, c-format
 msgid "Duplicate variable name `%s' within system file."
 msgstr ""
 
-#: src/data/sys-file-reader.c:512
+#: src/data/sys-file-reader.c:528
 msgid "Variable label indicator field is not 0 or 1."
 msgstr ""
 
-#: src/data/sys-file-reader.c:520
+#: src/data/sys-file-reader.c:536
 #, c-format
 msgid "Variable %s has label of invalid length %zu."
 msgstr ""
 
-#: src/data/sys-file-reader.c:539
+#: src/data/sys-file-reader.c:555
 msgid "Numeric missing value indicator field is not -3, -2, 0, 1, 2, or 3."
 msgstr ""
 
-#: src/data/sys-file-reader.c:554
+#: src/data/sys-file-reader.c:570
 msgid "String missing value indicator field is not 0, 1, 2, or 3."
 msgstr ""
 
-#: src/data/sys-file-reader.c:557
+#: src/data/sys-file-reader.c:573
 #, c-format
 msgid ""
 "Ignoring missing values on long string variable %s, which PSPP does not yet "
 "support."
 msgstr ""
 
-#: src/data/sys-file-reader.c:586
+#: src/data/sys-file-reader.c:602
 msgid "Missing string continuation record."
 msgstr ""
 
-#: src/data/sys-file-reader.c:620
+#: src/data/sys-file-reader.c:636
 #, c-format
 msgid "Unknown variable format %<PRIu8>."
 msgstr ""
 
-#: src/data/sys-file-reader.c:638
+#: src/data/sys-file-reader.c:654
 #, c-format
 msgid "%s variable %s has invalid %s format %s."
 msgstr ""
 
-#: src/data/sys-file-reader.c:641
+#: src/data/sys-file-reader.c:657
 msgid "print"
 msgstr ""
 
-#: src/data/sys-file-reader.c:641
+#: src/data/sys-file-reader.c:657
 msgid "write"
 msgstr ""
 
-#: src/data/sys-file-reader.c:645
+#: src/data/sys-file-reader.c:661
 msgid "Suppressing further invalid format warnings."
 msgstr ""
 
-#: src/data/sys-file-reader.c:663
+#: src/data/sys-file-reader.c:679
 msgid "Weighting variable must be numeric."
 msgstr ""
 
-#: src/data/sys-file-reader.c:677
+#: src/data/sys-file-reader.c:693
 msgid "Multiple type 6 (document) records."
 msgstr ""
 
-#: src/data/sys-file-reader.c:681
+#: src/data/sys-file-reader.c:697
 #, c-format
 msgid "Number of document lines (%d) must be greater than 0."
 msgstr ""
 
-#: src/data/sys-file-reader.c:689
+#: src/data/sys-file-reader.c:705
 msgid "Document line contains null byte."
 msgstr ""
 
-#: src/data/sys-file-reader.c:763
+#: src/data/sys-file-reader.c:782
 msgid ""
 "Ignoring value labels for long string variables, which PSPP does not yet "
 "support."
 msgstr ""
 
-#: src/data/sys-file-reader.c:768
+#: src/data/sys-file-reader.c:787
 #, c-format
 msgid "Unrecognized record type 7, subtype %d."
-msgstr ""
+msgstr "Unrecognised record type 7, subtype %d."
 
-#: src/data/sys-file-reader.c:793
+#: src/data/sys-file-reader.c:812
 #, c-format
 msgid "Bad size (%zu) or count (%zu) field on record type 7, subtype 3."
 msgstr ""
 
-#: src/data/sys-file-reader.c:813
+#: src/data/sys-file-reader.c:832
 #, c-format
 msgid ""
 "Floating-point representation indicated by system file (%d) differs from "
 "expected (%d)."
 msgstr ""
 
-#: src/data/sys-file-reader.c:826
+#: src/data/sys-file-reader.c:845
 msgid "little-endian"
 msgstr ""
 
-#: src/data/sys-file-reader.c:826
+#: src/data/sys-file-reader.c:845
 msgid "big-endian"
 msgstr ""
 
-#: src/data/sys-file-reader.c:827
+#: src/data/sys-file-reader.c:846
 #, c-format
 msgid ""
 "Integer format indicated by system file (%s) differs from expected (%s)."
 msgstr ""
 
-#: src/data/sys-file-reader.c:843
+#: src/data/sys-file-reader.c:862
 #, c-format
 msgid "Bad size (%zu) or count (%zu) on extension 4."
 msgstr ""
 
-#: src/data/sys-file-reader.c:847
+#: src/data/sys-file-reader.c:866
 #, c-format
 msgid "File specifies unexpected value %g as SYSMIS."
 msgstr ""
 
-#: src/data/sys-file-reader.c:849
+#: src/data/sys-file-reader.c:868
 #, c-format
 msgid "File specifies unexpected value %g as HIGHEST."
 msgstr ""
 
-#: src/data/sys-file-reader.c:851
+#: src/data/sys-file-reader.c:870
 #, c-format
 msgid "File specifies unexpected value %g as LOWEST."
 msgstr ""
 
-#: src/data/sys-file-reader.c:867
+#: src/data/sys-file-reader.c:886
 #, c-format
 msgid "Bad size %zu on extension 11."
 msgstr ""
 
-#: src/data/sys-file-reader.c:879
+#: src/data/sys-file-reader.c:898
 #, c-format
 msgid "Extension 11 has bad count %zu (for %zu variables)."
 msgstr ""
 
-#: src/data/sys-file-reader.c:900
+#: src/data/sys-file-reader.c:919
 #, c-format
 msgid ""
 "Invalid variable display parameters for variable %zu (%s).  Default "
 "parameters substituted."
 msgstr ""
 
-#: src/data/sys-file-reader.c:946
+#: src/data/sys-file-reader.c:963
 #, c-format
 msgid "Long variable mapping from %s to invalid variable name `%s'."
 msgstr ""
 
-#: src/data/sys-file-reader.c:956
+#: src/data/sys-file-reader.c:973
 #, c-format
 msgid "Duplicate long variable name `%s' within system file."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1011
+#: src/data/sys-file-reader.c:1026
 #, c-format
 msgid "%s listed as string of invalid length %s in very length string record."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1021
+#: src/data/sys-file-reader.c:1036
 #, c-format
 msgid ""
 "%s listed in very long string record with width %s, which requires only one "
 "segment."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1027
+#: src/data/sys-file-reader.c:1042
 #, c-format
 msgid "Very long string %s overflows dictionary."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1041
+#: src/data/sys-file-reader.c:1056
 #, c-format
 msgid ""
 "Very long string with width %ld has segment %d of width %d (expected %d)"
 msgstr ""
 
-#: src/data/sys-file-reader.c:1086
+#: src/data/sys-file-reader.c:1101
 #, c-format
 msgid "Invalid number of labels: %d.  Ignoring labels."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1117
+#: src/data/sys-file-reader.c:1132
 msgid ""
 "Variable index record (type 4) does not immediately follow value label "
 "record (type 3) as it should."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1124
+#: src/data/sys-file-reader.c:1139
 #, c-format
 msgid ""
 "Number of variables associated with a value label (%d) is not between 1 and "
 "the number of variables (%zu)."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1134
+#: src/data/sys-file-reader.c:1149
 #, c-format
 msgid "Value labels are not allowed on long string variables (%s)."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1141
+#: src/data/sys-file-reader.c:1156
 #, c-format
 msgid ""
 "Variables associated with value label are not all of identical type.  "
 "Variable %s is %s, but variable %s is %s."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1174
+#: src/data/sys-file-reader.c:1189
 #, c-format
 msgid "Duplicate value label for %g on %s."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1177
+#: src/data/sys-file-reader.c:1192
 #, c-format
 msgid "Duplicate value label for \"%.*s\" on %s."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1255
+#: src/data/sys-file-reader.c:1230
+#, c-format
+msgid "Error parsing attribute value %s[%d]"
+msgstr ""
+
+#: src/data/sys-file-reader.c:1244
+#, c-format
+msgid "Attribute value %s[%d] is not quoted: %s"
+msgstr ""
+
+#: src/data/sys-file-reader.c:1360
 msgid "File ends in partial case."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1263
+#: src/data/sys-file-reader.c:1368
 #, c-format
 msgid "Error reading case from file %s."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1360 src/data/sys-file-reader.c:1396
+#: src/data/sys-file-reader.c:1465 src/data/sys-file-reader.c:1501
 msgid "Compressed data is corrupt."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1483
+#: src/data/sys-file-reader.c:1588
 #, c-format
 msgid "Variable index %d not in valid range 1...%d."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1488
+#: src/data/sys-file-reader.c:1593
 #, c-format
 msgid "Variable index %d refers to long string continuation."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1574
+#: src/data/sys-file-reader.c:1661
 #, c-format
-msgid "Suppressed %d additional variable map warnings."
+msgid "Suppressed %d additional related warnings."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1587
+#: src/data/sys-file-reader.c:1702
 #, c-format
 msgid "Variable map refers to unknown variable %s."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1663
+#: src/data/sys-file-reader.c:1810
 #, c-format
 msgid "System error: %s."
 msgstr ""
 
-#: src/data/sys-file-reader.c:1665
+#: src/data/sys-file-reader.c:1812
 msgid "Unexpected end of file."
 msgstr ""
 
-#: src/data/sys-file-writer.c:163
+#: src/data/sys-file-writer.c:169
 #, c-format
 msgid "Unknown system file version %d. Treating as version %d."
 msgstr ""
 
-#: src/data/sys-file-writer.c:202
+#: src/data/sys-file-writer.c:208
 #, c-format
 msgid "Error opening \"%s\" for writing as a system file: %s."
 msgstr ""
 
-#: src/data/sys-file-writer.c:737
+#: src/data/sys-file-writer.c:813
 #, c-format
 msgid "An I/O error occurred writing system file \"%s\"."
 msgstr ""
 
-#: src/data/variable.c:209
+#: src/data/variable.c:236
 #, c-format
 msgid ""
 "Character `%c' (in %s) may not appear as the first character in a variable "
 "name."
 msgstr ""
 
-#: src/data/variable.c:221
+#: src/data/variable.c:248
 #, c-format
 msgid "Character `%c' (in %s) may not appear in a variable name."
 msgstr ""
 
-#: src/data/variable.c:249
+#: src/data/variable.c:276
 msgid "Variable name cannot be empty string."
 msgstr ""
 
-#: src/data/variable.c:255
+#: src/data/variable.c:282
 #, c-format
 msgid "Variable name %s exceeds %d-character limit."
 msgstr ""
 
-#: src/data/variable.c:263
+#: src/data/variable.c:290
 #, c-format
 msgid "`%s' may not be used as a variable name because it is a reserved word."
 msgstr ""
@@ -1222,23 +1237,23 @@ msgstr ""
 msgid "At least one variable must be specified."
 msgstr ""
 
-#: src/language/data-io/data-list.c:348 src/language/data-io/data-list.c:437
+#: src/language/data-io/data-list.c:349 src/language/data-io/data-list.c:438
 #: src/language/data-io/get-data.c:528
 #, c-format
 msgid "%s is a duplicate variable name."
 msgstr ""
 
-#: src/language/data-io/data-list.c:355
+#: src/language/data-io/data-list.c:356
 #, c-format
 msgid "There is already a variable %s of a different type."
 msgstr ""
 
-#: src/language/data-io/data-list.c:362
+#: src/language/data-io/data-list.c:363
 #, c-format
 msgid "There is already a string variable %s of a different width."
 msgstr ""
 
-#: src/language/data-io/data-list.c:370
+#: src/language/data-io/data-list.c:371
 #, c-format
 msgid "Cannot place variable %s on record %d when RECORDS=%d is specified."
 msgstr ""
@@ -1272,9 +1287,9 @@ msgstr ""
 #: src/language/data-io/data-parser.c:641
 #: src/language/data-io/data-parser.c:682 src/language/data-io/print.c:403
 #: src/language/dictionary/split-file.c:84
-#: src/language/dictionary/sys-file-info.c:161
-#: src/language/dictionary/sys-file-info.c:390
-#: src/language/dictionary/sys-file-info.c:634
+#: src/language/dictionary/sys-file-info.c:162
+#: src/language/dictionary/sys-file-info.c:386
+#: src/language/dictionary/sys-file-info.c:709
 #: src/language/stats/descriptives.c:883 src/ui/gui/dict-display.c:245
 msgid "Variable"
 msgstr ""
@@ -1317,57 +1332,57 @@ msgstr ""
 msgid "Could not open \"%s\" for reading as a data file: %s."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:190
+#: src/language/data-io/data-reader.c:191
 msgid ""
 "Unexpected end-of-file while reading data in BEGIN DATA.  This probably "
 "indicates a missing or misformatted END DATA command.  END DATA must appear "
 "by itself on a single line with exactly one space between words."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:215
+#: src/language/data-io/data-reader.c:216
 #, c-format
 msgid "Error reading file %s: %s."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:218
+#: src/language/data-io/data-reader.c:219
 #, c-format
 msgid "Unexpected end of file reading %s."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:227
+#: src/language/data-io/data-reader.c:228
 #, c-format
 msgid "Unexpected end of file in partial record reading %s."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:287
+#: src/language/data-io/data-reader.c:288
 #, c-format
 msgid "Corrupt block descriptor word at offset 0x%lx in %s."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:288
+#: src/language/data-io/data-reader.c:289
 #, c-format
 msgid "Corrupt record descriptor word at offset 0x%lx in %s."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:301
+#: src/language/data-io/data-reader.c:302
 #, c-format
 msgid "Corrupt record size at offset 0x%lx in %s."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:443
+#: src/language/data-io/data-reader.c:444
 msgid "Record exceeds remaining block length."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:517
+#: src/language/data-io/data-reader.c:518
 #, c-format
 msgid "Attempt to read beyond end-of-file on file %s."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:520
+#: src/language/data-io/data-reader.c:521
 msgid "Attempt to read beyond END DATA."
 msgstr ""
 
-#: src/language/data-io/data-reader.c:706
+#: src/language/data-io/data-reader.c:707
 msgid ""
 "This command is not valid here since the current input program does not "
 "access the inline file."
@@ -1456,6 +1471,9 @@ msgid ""
 "variables on right side (%zu), in parenthesized group %d of RENAME "
 "subcommand."
 msgstr ""
+"Number of variables on left side of `=' (%zu) does not match number of \n"
+"variables on right side (%zu), in parenthesised group %d of RENAME \n"
+"subcommand."
 
 #: src/language/data-io/get.c:585
 #, c-format
@@ -1681,7 +1699,7 @@ msgid_plural "Writing %d records."
 msgstr[0] ""
 msgstr[1] ""
 
-#: src/language/data-io/print-space.c:73 src/language/lexer/lexer.c:476
+#: src/language/data-io/print-space.c:73 src/language/lexer/lexer.c:477
 #: src/language/stats/autorecode.c:154 src/language/xforms/select-if.c:60
 msgid "expecting end of command"
 msgstr ""
@@ -1711,10 +1729,18 @@ msgid ""
 "Cannot apply missing values from source file to long string variable %s."
 msgstr ""
 
-#: src/language/dictionary/apply-dictionary.c:126
+#: src/language/dictionary/apply-dictionary.c:129
 msgid "No matching variables found between the source and target files."
 msgstr ""
 
+#: src/language/dictionary/attributes.c:108
+msgid "Attribute array index must be between 1 and 65535."
+msgstr ""
+
+#: src/language/dictionary/attributes.c:189
+msgid "expecting ATTRIBUTE= or DELETE="
+msgstr ""
+
 #: src/language/dictionary/delete-variables.c:40
 msgid ""
 "DELETE VARIABLES may not be used after TEMPORARY.  Temporary transformations "
@@ -1736,7 +1762,7 @@ msgid "`)' expected after output format."
 msgstr ""
 
 #: src/language/dictionary/missing-values.c:56
-#: src/language/stats/aggregate.c:451
+#: src/language/stats/aggregate.c:461
 msgid "expecting `('"
 msgstr ""
 
@@ -1820,7 +1846,7 @@ msgstr ""
 #: src/language/dictionary/modify-variables.c:302
 #, c-format
 msgid "Unrecognized subcommand name `%s'."
-msgstr ""
+msgstr "Unrecognised subcommand name `%s'."
 
 #: src/language/dictionary/modify-variables.c:304
 msgid "Subcommand name expected."
@@ -1869,233 +1895,239 @@ msgid "Renaming would duplicate variable name %s."
 msgstr ""
 
 #: src/language/dictionary/split-file.c:85
-#: src/language/dictionary/sys-file-info.c:563
+#: src/language/dictionary/sys-file-info.c:480
+#: src/language/dictionary/sys-file-info.c:629
 #: src/language/stats/crosstabs.q:1155 src/language/stats/crosstabs.q:1182
 #: src/language/stats/crosstabs.q:1202 src/language/stats/crosstabs.q:1224
 #: src/language/stats/examine.q:1948 src/language/stats/frequencies.q:1055
-#: src/language/stats/frequencies.q:1179
+#: src/language/stats/frequencies.q:1179 src/language/stats/reliability.q:572
+#: src/language/stats/reliability.q:583
 msgid "Value"
 msgstr ""
 
 #: src/language/dictionary/split-file.c:86
-#: src/language/dictionary/sys-file-info.c:397
-#: src/language/dictionary/sys-file-info.c:564 src/ui/gui/crosstabs.glade:275
+#: src/language/dictionary/sys-file-info.c:390
+#: src/language/dictionary/sys-file-info.c:630 src/ui/gui/crosstabs.glade:275
 #: src/ui/gui/psppire.glade:2099 src/ui/gui/psppire-var-sheet.c:104
 msgid "Label"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:110
+#: src/language/dictionary/sys-file-info.c:113
 msgid "File:"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:112 src/ui/gui/psppire.glade:2052
+#: src/language/dictionary/sys-file-info.c:115 src/ui/gui/psppire.glade:2052
 #: src/ui/gui/recode.glade:841
 msgid "Label:"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:116
+#: src/language/dictionary/sys-file-info.c:119
 msgid "No label."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:119
+#: src/language/dictionary/sys-file-info.c:122
 msgid "Created:"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:122
+#: src/language/dictionary/sys-file-info.c:125
 msgid "Integer Format:"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:124
+#: src/language/dictionary/sys-file-info.c:127
 msgid "Big Endian."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:125
+#: src/language/dictionary/sys-file-info.c:128
 msgid "Little Endian."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:126
-#: src/language/dictionary/sys-file-info.c:134
+#: src/language/dictionary/sys-file-info.c:129
+#: src/language/dictionary/sys-file-info.c:137
 msgid "Unknown."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:127
+#: src/language/dictionary/sys-file-info.c:130
 msgid "Real Format:"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:129
+#: src/language/dictionary/sys-file-info.c:132
 msgid "IEEE 754 LE."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:130
+#: src/language/dictionary/sys-file-info.c:133
 msgid "IEEE 754 BE."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:131
+#: src/language/dictionary/sys-file-info.c:134
 msgid "VAX D."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:132
+#: src/language/dictionary/sys-file-info.c:135
 msgid "VAX G."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:133
+#: src/language/dictionary/sys-file-info.c:136
 msgid "IBM 390 Hex Long."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:135
+#: src/language/dictionary/sys-file-info.c:138
 #: src/ui/gui/descriptives-dialog.glade:79 src/ui/gui/recode.glade:940
 msgid "Variables:"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:137
+#: src/language/dictionary/sys-file-info.c:140
 msgid "Cases:"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:139
+#: src/language/dictionary/sys-file-info.c:142
 msgid "Unknown"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:141
+#: src/language/dictionary/sys-file-info.c:144
 msgid "Type:"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:142
+#: src/language/dictionary/sys-file-info.c:145
 msgid "System File."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:143
+#: src/language/dictionary/sys-file-info.c:146
 msgid "Weight:"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:148
+#: src/language/dictionary/sys-file-info.c:151
 msgid "Not weighted."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:150
+#: src/language/dictionary/sys-file-info.c:153
 msgid "Mode:"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:152
+#: src/language/dictionary/sys-file-info.c:155
 #, c-format
 msgid "Compression %s."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:152
+#: src/language/dictionary/sys-file-info.c:155
 msgid "on"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:152
+#: src/language/dictionary/sys-file-info.c:155
 msgid "off"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:162
-#: src/language/dictionary/sys-file-info.c:395
+#: src/language/dictionary/sys-file-info.c:163
+#: src/language/dictionary/sys-file-info.c:390
 msgid "Description"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:163
-#: src/language/dictionary/sys-file-info.c:393
-#: src/language/dictionary/sys-file-info.c:633
+#: src/language/dictionary/sys-file-info.c:164
+#: src/language/dictionary/sys-file-info.c:392
+#: src/language/dictionary/sys-file-info.c:708
 msgid "Position"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:222
+#: src/language/dictionary/sys-file-info.c:213
 msgid "The active file does not have a file label."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:225
+#: src/language/dictionary/sys-file-info.c:216
 msgid "File label:"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:288
+#: src/language/dictionary/sys-file-info.c:291
 msgid "No variables to display."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:307
+#: src/language/dictionary/sys-file-info.c:306
 msgid "Macros not supported."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:317
+#: src/language/dictionary/sys-file-info.c:316
 msgid "The active file dictionary does not contain any documents."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:325
+#: src/language/dictionary/sys-file-info.c:324
 msgid "Documents in the active file:"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:477
+#: src/language/dictionary/sys-file-info.c:479
+msgid "Attribute"
+msgstr ""
+
+#: src/language/dictionary/sys-file-info.c:537
 #, c-format
 msgid "Format: %s"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:485
+#: src/language/dictionary/sys-file-info.c:544
 #, c-format
 msgid "Print Format: %s"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:488
+#: src/language/dictionary/sys-file-info.c:547
 #, c-format
 msgid "Write Format: %s"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:494
+#: src/language/dictionary/sys-file-info.c:559
 #, c-format
 msgid "Measure: %s"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:495
+#: src/language/dictionary/sys-file-info.c:560
 #: src/ui/gui/psppire-var-sheet.c:123
 msgid "Nominal"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:496
+#: src/language/dictionary/sys-file-info.c:561
 #: src/ui/gui/psppire-var-sheet.c:124
 msgid "Ordinal"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:497
+#: src/language/dictionary/sys-file-info.c:562
 #: src/ui/gui/psppire-var-sheet.c:125
 msgid "Scale"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:500
+#: src/language/dictionary/sys-file-info.c:565
 #, c-format
 msgid "Display Alignment: %s"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:501
+#: src/language/dictionary/sys-file-info.c:566
 #: src/ui/gui/psppire-var-sheet.c:116
 msgid "Left"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:502
+#: src/language/dictionary/sys-file-info.c:567
 #: src/ui/gui/psppire-var-sheet.c:118
 msgid "Center"
 msgstr "Centre"
 
-#: src/language/dictionary/sys-file-info.c:503
+#: src/language/dictionary/sys-file-info.c:568
 #: src/ui/gui/psppire-var-sheet.c:117
 msgid "Right"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:506
+#: src/language/dictionary/sys-file-info.c:571
 #, c-format
 msgid "Display Width: %d"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:517
+#: src/language/dictionary/sys-file-info.c:583
 msgid "Missing Values: "
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:611
+#: src/language/dictionary/sys-file-info.c:686
 msgid "No vectors defined."
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:632
+#: src/language/dictionary/sys-file-info.c:707
 msgid "Vector"
 msgstr ""
 
-#: src/language/dictionary/sys-file-info.c:635
+#: src/language/dictionary/sys-file-info.c:710
 msgid "Print Format"
 msgstr ""
 
@@ -2106,20 +2138,15 @@ msgid ""
 "s."
 msgstr ""
 
-#: src/language/dictionary/value-labels.c:157 src/language/lexer/lexer.c:629
+#: src/language/dictionary/value-labels.c:157 src/language/lexer/lexer.c:630
 msgid "expecting string"
 msgstr ""
 
-#: src/language/dictionary/value-labels.c:166 src/language/lexer/lexer.c:643
-msgid "expecting integer"
-msgstr ""
-
-#: src/language/dictionary/value-labels.c:170
-#, c-format
-msgid "Value label `%g' is not integer."
+#: src/language/dictionary/value-labels.c:166 src/language/lexer/lexer.c:657
+msgid "expecting number"
 msgstr ""
 
-#: src/language/dictionary/value-labels.c:184
+#: src/language/dictionary/value-labels.c:182
 msgid "Truncating value label to 60 characters."
 msgstr ""
 
@@ -2226,6 +2253,8 @@ msgid ""
 "Unrecognized date unit \"%.*s\".  Valid date units are \"years\", \"quarters"
 "\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", and \"seconds\"."
 msgstr ""
+"Unrecognised date unit \"%.*s\".  Valid date units are \"years\", \"quarters\"\n"
+"\"\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", and \"seconds\"."
 
 #: src/language/expressions/helpers.c:332
 msgid ""
@@ -2274,7 +2303,7 @@ msgstr ""
 msgid "Unknown identifier %s."
 msgstr ""
 
-#: src/language/expressions/parse.c:885 src/language/stats/aggregate.c:509
+#: src/language/expressions/parse.c:885 src/language/stats/aggregate.c:519
 msgid "expecting `)'"
 msgstr ""
 
@@ -2342,8 +2371,7 @@ msgstr ""
 msgid "%s is a PSPP extension."
 msgstr ""
 
-#: src/language/expressions/parse.c:1267 src/ui/terminal/command-line.c:127
-#: src/ui/terminal/command-line.c:146 src/ui/terminal/command-line.c:158
+#: src/language/expressions/parse.c:1267
 #, c-format
 msgid "%s is not yet implemented."
 msgstr ""
@@ -2366,84 +2394,84 @@ msgstr ""
 msgid "%s does not form a valid number."
 msgstr ""
 
-#: src/language/lexer/lexer.c:386
+#: src/language/lexer/lexer.c:387
 #, c-format
 msgid "Bad character in input: `%c'."
 msgstr ""
 
-#: src/language/lexer/lexer.c:388
+#: src/language/lexer/lexer.c:389
 #, c-format
 msgid "Bad character in input: `\\%o'."
 msgstr ""
 
-#: src/language/lexer/lexer.c:424
+#: src/language/lexer/lexer.c:425
 #, c-format
 msgid "Subcommand %s may only be specified once."
 msgstr ""
 
-#: src/language/lexer/lexer.c:432
+#: src/language/lexer/lexer.c:433
 #, c-format
 msgid "missing required subcommand %s"
 msgstr ""
 
-#: src/language/lexer/lexer.c:461
+#: src/language/lexer/lexer.c:462
 #, c-format
 msgid "Syntax error %s at %s."
 msgstr ""
 
-#: src/language/lexer/lexer.c:464
+#: src/language/lexer/lexer.c:465
 #, c-format
 msgid "Syntax error at %s."
 msgstr ""
 
-#: src/language/lexer/lexer.c:598 src/language/lexer/lexer.c:615
+#: src/language/lexer/lexer.c:599 src/language/lexer/lexer.c:616
 #, c-format
 msgid "expecting `%s'"
 msgstr ""
 
-#: src/language/lexer/lexer.c:656
-msgid "expecting number"
+#: src/language/lexer/lexer.c:644
+msgid "expecting integer"
 msgstr ""
 
-#: src/language/lexer/lexer.c:668
+#: src/language/lexer/lexer.c:669
 msgid "expecting identifier"
 msgstr ""
 
-#: src/language/lexer/lexer.c:1062
+#: src/language/lexer/lexer.c:1063
 msgid "binary"
 msgstr ""
 
-#: src/language/lexer/lexer.c:1067
+#: src/language/lexer/lexer.c:1068
 msgid "octal"
 msgstr ""
 
-#: src/language/lexer/lexer.c:1072
+#: src/language/lexer/lexer.c:1073
 msgid "hex"
 msgstr ""
 
-#: src/language/lexer/lexer.c:1082
+#: src/language/lexer/lexer.c:1083
 #, c-format
 msgid "String of %s digits has %zu characters, which is not a multiple of %d."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1111
+#: src/language/lexer/lexer.c:1112
 #, c-format
 msgid "`%c' is not a valid %s digit."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1145
+#: src/language/lexer/lexer.c:1146
 msgid "Unterminated string constant."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1199
+#: src/language/lexer/lexer.c:1200
 msgid "Unexpected end of file in string concatenation."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1207
+#: src/language/lexer/lexer.c:1208
 msgid "String expected following `+'."
 msgstr ""
 
-#: src/language/lexer/lexer.c:1220
+#: src/language/lexer/lexer.c:1221
 #, c-format
 msgid "String exceeds 255 characters in length (%zu characters)."
 msgstr ""
@@ -2546,54 +2574,54 @@ msgstr ""
 msgid "Bad bounds in use of TO convention."
 msgstr ""
 
-#: src/language/stats/aggregate.c:209
+#: src/language/stats/aggregate.c:218
 msgid "while expecting COLUMNWISE"
 msgstr ""
 
-#: src/language/stats/aggregate.c:240
+#: src/language/stats/aggregate.c:249
 msgid "expecting BREAK"
 msgstr ""
 
-#: src/language/stats/aggregate.c:245
+#: src/language/stats/aggregate.c:254
 msgid ""
 "When PRESORTED is specified, specifying sorting directions with (A) or (D) "
 "has no effect.  Output data will be sorted the same way as the input data."
 msgstr ""
 
-#: src/language/stats/aggregate.c:416
+#: src/language/stats/aggregate.c:426
 msgid "expecting aggregation function"
 msgstr ""
 
-#: src/language/stats/aggregate.c:434
+#: src/language/stats/aggregate.c:444
 #, c-format
 msgid "Unknown aggregation function %s."
 msgstr ""
 
-#: src/language/stats/aggregate.c:490
+#: src/language/stats/aggregate.c:500
 #, c-format
 msgid "Missing argument %zu to %s."
 msgstr ""
 
-#: src/language/stats/aggregate.c:499
+#: src/language/stats/aggregate.c:509
 #, c-format
 msgid "Arguments to %s must be of same type as source variables."
 msgstr ""
 
-#: src/language/stats/aggregate.c:521
+#: src/language/stats/aggregate.c:531
 #, c-format
 msgid ""
 "Number of source variables (%zu) does not match number of target variables (%"
 "zu)."
 msgstr ""
 
-#: src/language/stats/aggregate.c:537
+#: src/language/stats/aggregate.c:547
 #, c-format
 msgid ""
 "The value arguments passed to the %s function are out-of-order.  They will "
 "be treated as if they had been specified in the correct order."
 msgstr ""
 
-#: src/language/stats/aggregate.c:607
+#: src/language/stats/aggregate.c:617
 #, c-format
 msgid ""
 "Variable name %s is not unique within the aggregate file dictionary, which "
@@ -2620,49 +2648,51 @@ msgstr ""
 msgid "Variable %s is not dichotomous"
 msgstr ""
 
-#: src/language/stats/binomial.c:177
+#: src/language/stats/binomial.c:179
 msgid "Binomial Test"
 msgstr ""
 
-#: src/language/stats/binomial.c:201
+#: src/language/stats/binomial.c:203
 msgid "Group1"
 msgstr ""
 
-#: src/language/stats/binomial.c:202
+#: src/language/stats/binomial.c:204
 msgid "Group2"
 msgstr ""
 
-#: src/language/stats/binomial.c:203 src/language/stats/chisquare.c:223
+#: src/language/stats/binomial.c:205 src/language/stats/chisquare.c:223
 #: src/language/stats/chisquare.c:283 src/language/stats/crosstabs.q:862
 #: src/language/stats/crosstabs.q:1062 src/language/stats/crosstabs.q:1785
 #: src/language/stats/examine.q:1207 src/language/stats/frequencies.q:1132
-#: src/language/stats/oneway.q:306 src/language/stats/oneway.q:476
-#: src/language/stats/regression.q:309 src/ui/gui/crosstabs-dialog.c:59
+#: src/language/stats/oneway.q:304 src/language/stats/oneway.q:470
+#: src/language/stats/regression.q:309 src/language/stats/reliability.q:705
+#: src/language/stats/wilcoxon.c:246 src/ui/gui/crosstabs-dialog.c:59
 msgid "Total"
 msgstr ""
 
-#: src/language/stats/binomial.c:235 src/language/stats/chisquare.c:246
+#: src/language/stats/binomial.c:237 src/language/stats/chisquare.c:246
 #: src/language/stats/crosstabs.q:1180 src/language/stats/crosstabs.q:1221
 msgid "Category"
 msgstr ""
 
-#: src/language/stats/binomial.c:236 src/language/stats/crosstabs.q:872
+#: src/language/stats/binomial.c:238 src/language/stats/crosstabs.q:872
 #: src/language/stats/examine.q:1280 src/language/stats/frequencies.q:1400
-#: src/language/stats/npar-summary.c:122 src/language/stats/oneway.q:391
-#: src/language/stats/t-test.q:693 src/language/stats/t-test.q:716
-#: src/language/stats/t-test.q:850 src/language/stats/t-test.q:1387
+#: src/language/stats/npar-summary.c:122 src/language/stats/oneway.q:386
+#: src/language/stats/reliability.q:708 src/language/stats/t-test.q:693
+#: src/language/stats/t-test.q:716 src/language/stats/t-test.q:850
+#: src/language/stats/t-test.q:1387 src/language/stats/wilcoxon.c:229
 msgid "N"
 msgstr ""
 
-#: src/language/stats/binomial.c:237
+#: src/language/stats/binomial.c:239
 msgid "Observed Prop."
 msgstr ""
 
-#: src/language/stats/binomial.c:238
+#: src/language/stats/binomial.c:240
 msgid "Test Prop."
 msgstr ""
 
-#: src/language/stats/binomial.c:241
+#: src/language/stats/binomial.c:243
 #, c-format
 msgid "Exact Sig. (%d-tailed)"
 msgstr ""
@@ -2691,7 +2721,7 @@ msgstr ""
 msgid "Frequencies"
 msgstr ""
 
-#: src/language/stats/chisquare.c:297
+#: src/language/stats/chisquare.c:297 src/language/stats/wilcoxon.c:297
 msgid "Test Statistics"
 msgstr ""
 
@@ -2700,7 +2730,7 @@ msgid "Chi-Square"
 msgstr ""
 
 #: src/language/stats/chisquare.c:312 src/language/stats/crosstabs.q:1156
-#: src/language/stats/oneway.q:279 src/language/stats/oneway.q:694
+#: src/language/stats/oneway.q:277 src/language/stats/oneway.q:683
 #: src/language/stats/regression.q:302 src/language/stats/t-test.q:1001
 #: src/language/stats/t-test.q:1193 src/language/stats/t-test.q:1286
 msgid "df"
@@ -2741,11 +2771,13 @@ msgid "Summary."
 msgstr ""
 
 #: src/language/stats/crosstabs.q:859 src/language/stats/examine.q:1268
+#: src/language/stats/reliability.q:696
 msgid "Cases"
 msgstr ""
 
 #: src/language/stats/crosstabs.q:860 src/language/stats/examine.q:1205
 #: src/language/stats/frequencies.q:1053 src/language/stats/frequencies.q:1401
+#: src/language/stats/reliability.q:699
 msgid "Valid"
 msgstr ""
 
@@ -2859,139 +2891,139 @@ msgstr ""
 msgid "Type"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:1977
+#: src/language/stats/crosstabs.q:1976
 msgid "Pearson Chi-Square"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:1978
+#: src/language/stats/crosstabs.q:1977
 msgid "Likelihood Ratio"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:1979
+#: src/language/stats/crosstabs.q:1978
 msgid "Fisher's Exact Test"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:1980
+#: src/language/stats/crosstabs.q:1979
 msgid "Continuity Correction"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:1981
+#: src/language/stats/crosstabs.q:1980
 msgid "Linear-by-Linear Association"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2018 src/language/stats/crosstabs.q:2088
-#: src/language/stats/crosstabs.q:2147
+#: src/language/stats/crosstabs.q:2017 src/language/stats/crosstabs.q:2087
+#: src/language/stats/crosstabs.q:2146
 msgid "N of Valid Cases"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2034 src/language/stats/crosstabs.q:2163
+#: src/language/stats/crosstabs.q:2033 src/language/stats/crosstabs.q:2162
 msgid "Nominal by Nominal"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2035 src/language/stats/crosstabs.q:2164
+#: src/language/stats/crosstabs.q:2034 src/language/stats/crosstabs.q:2163
 msgid "Ordinal by Ordinal"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2036
+#: src/language/stats/crosstabs.q:2035
 msgid "Interval by Interval"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2037
+#: src/language/stats/crosstabs.q:2036
 msgid "Measure of Agreement"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2042 src/ui/gui/crosstabs-dialog.c:41
+#: src/language/stats/crosstabs.q:2041 src/ui/gui/crosstabs-dialog.c:41
 msgid "Phi"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2043
+#: src/language/stats/crosstabs.q:2042
 msgid "Cramer's V"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2044
+#: src/language/stats/crosstabs.q:2043
 msgid "Contingency Coefficient"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2045
+#: src/language/stats/crosstabs.q:2044
 msgid "Kendall's tau-b"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2046
+#: src/language/stats/crosstabs.q:2045
 msgid "Kendall's tau-c"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2047 src/ui/gui/crosstabs-dialog.c:48
+#: src/language/stats/crosstabs.q:2046 src/ui/gui/crosstabs-dialog.c:48
 msgid "Gamma"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2048
+#: src/language/stats/crosstabs.q:2047
 msgid "Spearman Correlation"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2049
+#: src/language/stats/crosstabs.q:2048
 msgid "Pearson's R"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2050 src/ui/gui/crosstabs-dialog.c:50
+#: src/language/stats/crosstabs.q:2049 src/ui/gui/crosstabs-dialog.c:50
 msgid "Kappa"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2120
+#: src/language/stats/crosstabs.q:2119
 #, c-format
 msgid "Odds Ratio for %s (%g / %g)"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2123
+#: src/language/stats/crosstabs.q:2122
 #, c-format
 msgid "Odds Ratio for %s (%.*s / %.*s)"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2131
+#: src/language/stats/crosstabs.q:2130
 #, c-format
 msgid "For cohort %s = %g"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2134
+#: src/language/stats/crosstabs.q:2133
 #, c-format
 msgid "For cohort %s = %.*s"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2165
+#: src/language/stats/crosstabs.q:2164
 msgid "Nominal by Interval"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2170 src/ui/gui/crosstabs-dialog.c:43
+#: src/language/stats/crosstabs.q:2169 src/ui/gui/crosstabs-dialog.c:43
 msgid "Lambda"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2171
+#: src/language/stats/crosstabs.q:2170
 msgid "Goodman and Kruskal tau"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2172
+#: src/language/stats/crosstabs.q:2171
 msgid "Uncertainty Coefficient"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2173
+#: src/language/stats/crosstabs.q:2172
 msgid "Somers' d"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2174 src/ui/gui/crosstabs-dialog.c:51
+#: src/language/stats/crosstabs.q:2173 src/ui/gui/crosstabs-dialog.c:51
 msgid "Eta"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2179
+#: src/language/stats/crosstabs.q:2178
 msgid "Symmetric"
 msgstr ""
 
-#: src/language/stats/crosstabs.q:2180 src/language/stats/crosstabs.q:2181
+#: src/language/stats/crosstabs.q:2179 src/language/stats/crosstabs.q:2180
 #, c-format
 msgid "%s Dependent"
 msgstr ""
 
 #: src/language/stats/descriptives.c:102 src/language/stats/examine.q:1550
 #: src/language/stats/frequencies.q:123 src/language/stats/npar-summary.c:125
-#: src/language/stats/oneway.q:392 src/language/stats/t-test.q:694
+#: src/language/stats/oneway.q:387 src/language/stats/t-test.q:694
 #: src/language/stats/t-test.q:717 src/language/stats/t-test.q:849
 #: src/language/stats/t-test.q:1187 src/ui/gui/descriptives-dialog.c:39
 #: src/ui/gui/frequencies-dialog.c:40
@@ -3040,14 +3072,14 @@ msgstr ""
 
 #: src/language/stats/descriptives.c:111 src/language/stats/examine.q:1591
 #: src/language/stats/frequencies.q:134 src/language/stats/npar-summary.c:131
-#: src/language/stats/oneway.q:404 src/ui/gui/descriptives-dialog.c:41
+#: src/language/stats/oneway.q:400 src/ui/gui/descriptives-dialog.c:41
 #: src/ui/gui/frequencies-dialog.c:42
 msgid "Minimum"
 msgstr ""
 
 #: src/language/stats/descriptives.c:112 src/language/stats/examine.q:1596
 #: src/language/stats/frequencies.q:135 src/language/stats/npar-summary.c:134
-#: src/language/stats/oneway.q:405 src/ui/gui/descriptives-dialog.c:42
+#: src/language/stats/oneway.q:401 src/ui/gui/descriptives-dialog.c:42
 #: src/ui/gui/frequencies-dialog.c:43
 msgid "Maximum"
 msgstr ""
@@ -3144,20 +3176,20 @@ msgstr ""
 msgid "%s and %s are mutually exclusive"
 msgstr ""
 
-#: src/language/stats/examine.q:1263
+#: src/language/stats/examine.q:1263 src/language/stats/reliability.q:673
 msgid "Case Processing Summary"
 msgstr ""
 
-#: src/language/stats/examine.q:1555 src/language/stats/oneway.q:399
+#: src/language/stats/examine.q:1555 src/language/stats/oneway.q:395
 #, c-format
 msgid "%g%% Confidence Interval for Mean"
 msgstr ""
 
-#: src/language/stats/examine.q:1561 src/language/stats/oneway.q:401
+#: src/language/stats/examine.q:1561 src/language/stats/oneway.q:397
 msgid "Lower Bound"
 msgstr ""
 
-#: src/language/stats/examine.q:1566 src/language/stats/oneway.q:402
+#: src/language/stats/examine.q:1566 src/language/stats/oneway.q:398
 msgid "Upper Bound"
 msgstr ""
 
@@ -3172,7 +3204,7 @@ msgid "Median"
 msgstr ""
 
 #: src/language/stats/examine.q:1586 src/language/stats/npar-summary.c:128
-#: src/language/stats/oneway.q:393 src/language/stats/t-test.q:695
+#: src/language/stats/oneway.q:388 src/language/stats/t-test.q:695
 #: src/language/stats/t-test.q:718 src/language/stats/t-test.q:851
 #: src/language/stats/t-test.q:1188
 msgid "Std. Deviation"
@@ -3182,13 +3214,13 @@ msgstr ""
 msgid "Interquartile Range"
 msgstr ""
 
-#: src/language/stats/examine.q:1742 src/language/stats/oneway.q:408
+#: src/language/stats/examine.q:1742 src/language/stats/oneway.q:404
 #: src/ui/gui/examine.glade:307
 msgid "Descriptives"
 msgstr ""
 
-#: src/language/stats/examine.q:1748 src/language/stats/oneway.q:394
-#: src/language/stats/oneway.q:692 src/language/stats/regression.q:203
+#: src/language/stats/examine.q:1748 src/language/stats/oneway.q:389
+#: src/language/stats/oneway.q:681 src/language/stats/regression.q:203
 msgid "Std. Error"
 msgstr ""
 
@@ -3379,11 +3411,11 @@ msgstr ""
 msgid "50 (Median)"
 msgstr ""
 
-#: src/language/stats/glm.q:148
+#: src/language/stats/glm.q:143
 msgid "Multivariate GLM not yet supported"
 msgstr ""
 
-#: src/language/stats/glm.q:356 src/language/stats/regression.q:1026
+#: src/language/stats/glm.q:325 src/language/stats/regression.q:994
 msgid "No valid data found. This command was skipped."
 msgstr ""
 
@@ -3395,24 +3427,24 @@ msgstr ""
 msgid "TABLES subcommand may not appear more than once."
 msgstr ""
 
-#: src/language/stats/npar.q:98
+#: src/language/stats/npar.q:108
 msgid "NPAR subcommand not currently implemented."
 msgstr ""
 
-#: src/language/stats/npar.q:237
+#: src/language/stats/npar.q:251
 #, c-format
 msgid ""
 "The specified value of HI (%d) is lower than the specified value of LO (%d)"
 msgstr ""
 
-#: src/language/stats/npar.q:292
+#: src/language/stats/npar.q:306
 #, c-format
 msgid ""
 "%d expected values were given, but the specified range (%d-%d) requires "
 "exactly %d values."
 msgstr ""
 
-#: src/language/stats/npar.q:426 src/language/stats/t-test.q:496
+#: src/language/stats/npar.q:443 src/language/stats/t-test.q:496
 #, c-format
 msgid ""
 "PAIRED was specified but the number of variables preceding WITH (%zu) did "
@@ -3435,98 +3467,98 @@ msgstr ""
 msgid "75th"
 msgstr ""
 
-#: src/language/stats/oneway.q:169
+#: src/language/stats/oneway.q:170
 msgid "Number of contrast coefficients must equal the number of groups"
 msgstr ""
 
-#: src/language/stats/oneway.q:178
+#: src/language/stats/oneway.q:179
 #, c-format
 msgid "Coefficients for contrast %zu do not total zero"
 msgstr ""
 
-#: src/language/stats/oneway.q:244
+#: src/language/stats/oneway.q:242
 #, c-format
 msgid "`%s' is not a variable name"
 msgstr ""
 
-#: src/language/stats/oneway.q:278 src/language/stats/regression.q:301
+#: src/language/stats/oneway.q:276 src/language/stats/regression.q:301
 msgid "Sum of Squares"
 msgstr ""
 
-#: src/language/stats/oneway.q:280 src/language/stats/regression.q:303
+#: src/language/stats/oneway.q:278 src/language/stats/regression.q:303
 msgid "Mean Square"
 msgstr ""
 
-#: src/language/stats/oneway.q:281 src/language/stats/regression.q:304
+#: src/language/stats/oneway.q:279 src/language/stats/regression.q:304
 #: src/language/stats/t-test.q:998
 msgid "F"
 msgstr ""
 
-#: src/language/stats/oneway.q:282 src/language/stats/oneway.q:542
+#: src/language/stats/oneway.q:280 src/language/stats/oneway.q:532
 #: src/language/stats/regression.q:206 src/language/stats/regression.q:305
 msgid "Significance"
 msgstr ""
 
-#: src/language/stats/oneway.q:304
+#: src/language/stats/oneway.q:302
 msgid "Between Groups"
 msgstr ""
 
-#: src/language/stats/oneway.q:305
+#: src/language/stats/oneway.q:303
 msgid "Within Groups"
 msgstr ""
 
-#: src/language/stats/oneway.q:352 src/language/stats/regression.q:330
+#: src/language/stats/oneway.q:347 src/language/stats/regression.q:330
 msgid "ANOVA"
 msgstr ""
 
-#: src/language/stats/oneway.q:539
+#: src/language/stats/oneway.q:529
 msgid "Levene Statistic"
 msgstr ""
 
-#: src/language/stats/oneway.q:540
+#: src/language/stats/oneway.q:530
 msgid "df1"
 msgstr ""
 
-#: src/language/stats/oneway.q:541
+#: src/language/stats/oneway.q:531
 msgid "df2"
 msgstr ""
 
-#: src/language/stats/oneway.q:545
+#: src/language/stats/oneway.q:534
 msgid "Test of Homogeneity of Variances"
 msgstr ""
 
-#: src/language/stats/oneway.q:613
+#: src/language/stats/oneway.q:602
 msgid "Contrast Coefficients"
 msgstr ""
 
-#: src/language/stats/oneway.q:615 src/language/stats/oneway.q:690
+#: src/language/stats/oneway.q:604 src/language/stats/oneway.q:679
 msgid "Contrast"
 msgstr ""
 
-#: src/language/stats/oneway.q:688
+#: src/language/stats/oneway.q:677
 msgid "Contrast Tests"
 msgstr ""
 
-#: src/language/stats/oneway.q:691
+#: src/language/stats/oneway.q:680
 msgid "Value of Contrast"
 msgstr ""
 
-#: src/language/stats/oneway.q:693 src/language/stats/regression.q:205
+#: src/language/stats/oneway.q:682 src/language/stats/regression.q:205
 #: src/language/stats/t-test.q:1000 src/language/stats/t-test.q:1192
 #: src/language/stats/t-test.q:1285
 msgid "t"
 msgstr ""
 
-#: src/language/stats/oneway.q:695 src/language/stats/t-test.q:1002
+#: src/language/stats/oneway.q:684 src/language/stats/t-test.q:1002
 #: src/language/stats/t-test.q:1194 src/language/stats/t-test.q:1287
 msgid "Sig. (2-tailed)"
 msgstr ""
 
-#: src/language/stats/oneway.q:739
+#: src/language/stats/oneway.q:728
 msgid "Assume equal variances"
 msgstr ""
 
-#: src/language/stats/oneway.q:743
+#: src/language/stats/oneway.q:732
 msgid "Does not assume equal"
 msgstr ""
 
@@ -3642,10 +3674,87 @@ msgid ""
 "meaningless."
 msgstr ""
 
-#: src/language/stats/regression.q:931
+#: src/language/stats/regression.q:898
 msgid "Dependent variable must be numeric."
 msgstr ""
 
+#: src/language/stats/reliability.q:429
+msgid "Reliability Statistics"
+msgstr ""
+
+#: src/language/stats/reliability.q:472
+msgid "Item-Total Statistics"
+msgstr ""
+
+#: src/language/stats/reliability.q:494
+msgid "Scale Mean if Item Deleted"
+msgstr ""
+
+#: src/language/stats/reliability.q:497
+msgid "Scale Variance if Item Deleted"
+msgstr ""
+
+#: src/language/stats/reliability.q:500
+msgid "Corrected Item-Total Correlation"
+msgstr ""
+
+#: src/language/stats/reliability.q:503
+msgid "Cronbach's Alpha if Item Deleted"
+msgstr ""
+
+#: src/language/stats/reliability.q:550 src/language/stats/reliability.q:566
+msgid "Cronbach's Alpha"
+msgstr ""
+
+#: src/language/stats/reliability.q:553
+msgid "N of items"
+msgstr ""
+
+#: src/language/stats/reliability.q:569
+msgid "Part 1"
+msgstr ""
+
+#: src/language/stats/reliability.q:575 src/language/stats/reliability.q:586
+msgid "N of Items"
+msgstr ""
+
+#: src/language/stats/reliability.q:580
+msgid "Part 2"
+msgstr ""
+
+#: src/language/stats/reliability.q:591
+msgid "Total N of Items"
+msgstr ""
+
+#: src/language/stats/reliability.q:594
+msgid "Correlation Between Forms"
+msgstr ""
+
+#: src/language/stats/reliability.q:598
+msgid "Spearman-Brown Coefficient"
+msgstr ""
+
+#: src/language/stats/reliability.q:601
+msgid "Equal Length"
+msgstr ""
+
+#: src/language/stats/reliability.q:604
+msgid "Unequal Length"
+msgstr ""
+
+#: src/language/stats/reliability.q:608
+msgid "Guttman Split-Half Coefficient"
+msgstr ""
+
+#: src/language/stats/reliability.q:702
+msgid "Excluded"
+msgstr ""
+
+#: src/language/stats/reliability.q:711
+#, c-format
+msgid "%%"
+msgstr ""
+
 #: src/language/stats/sort-cases.c:64
 msgid "Buffer limit must be at least 2."
 msgstr ""
@@ -3784,6 +3893,56 @@ msgstr ""
 msgid "%s & %s"
 msgstr ""
 
+#: src/language/stats/wilcoxon.c:216
+msgid "Ranks"
+msgstr ""
+
+#: src/language/stats/wilcoxon.c:230
+msgid "Mean Rank"
+msgstr ""
+
+#: src/language/stats/wilcoxon.c:231
+msgid "Sum of Ranks"
+msgstr ""
+
+#: src/language/stats/wilcoxon.c:243
+msgid "Negative Ranks"
+msgstr ""
+
+#: src/language/stats/wilcoxon.c:244
+msgid "Positive Ranks"
+msgstr ""
+
+#: src/language/stats/wilcoxon.c:245
+msgid "Ties"
+msgstr ""
+
+#: src/language/stats/wilcoxon.c:310
+msgid "Z"
+msgstr ""
+
+#: src/language/stats/wilcoxon.c:311
+msgid "Asymp. Sig (2-tailed)"
+msgstr ""
+
+#: src/language/stats/wilcoxon.c:315
+msgid "Exact Sig (2-tailed)"
+msgstr ""
+
+#: src/language/stats/wilcoxon.c:316
+msgid "Exact Sig (1-tailed)"
+msgstr ""
+
+#: src/language/stats/wilcoxon.c:319
+msgid "Point Probability"
+msgstr ""
+
+#: src/language/stats/wilcoxon.c:358
+#, c-format
+msgid ""
+"Exact significance was not calculated after %.2f minutes. Skipping test."
+msgstr ""
+
 #: src/language/syntax-file.c:88
 #, c-format
 msgid "opening \"%s\" as syntax file"
@@ -4062,44 +4221,44 @@ msgstr ""
 msgid "Destination cannot be a string variable."
 msgstr ""
 
-#: src/language/xforms/recode.c:246
+#: src/language/xforms/recode.c:251
 msgid ""
 "Inconsistent target variable types.  Target variables must be all numeric or "
 "all string."
 msgstr ""
 
-#: src/language/xforms/recode.c:267
+#: src/language/xforms/recode.c:272
 msgid "CONVERT requires string input values and numeric output values."
 msgstr ""
 
-#: src/language/xforms/recode.c:317
+#: src/language/xforms/recode.c:329
 msgid "THRU is not allowed with string variables."
 msgstr ""
 
-#: src/language/xforms/recode.c:391
+#: src/language/xforms/recode.c:407
 msgid "expecting output value"
 msgstr ""
 
-#: src/language/xforms/recode.c:440
+#: src/language/xforms/recode.c:456
 #, c-format
 msgid ""
 "%zu variable(s) cannot be recoded into %zu variable(s).  Specify the same "
 "number of variables as source and target variables."
 msgstr ""
 
-#: src/language/xforms/recode.c:455
+#: src/language/xforms/recode.c:471
 #, c-format
 msgid ""
 "There is no variable named %s.  (All string variables specified on INTO must "
 "already exist.  Use the STRING command to create a string variable.)"
 msgstr ""
 
-#: src/language/xforms/recode.c:470
+#: src/language/xforms/recode.c:487
 #, c-format
 msgid "INTO is required with %s input values and %s output values."
 msgstr ""
 
-#: src/language/xforms/recode.c:483
+#: src/language/xforms/recode.c:500
 #, c-format
 msgid "Type mismatch.  Cannot store %s data in %s variable %s."
 msgstr ""
@@ -4125,7 +4284,7 @@ msgstr ""
 msgid "The filter variable may not be scratch."
 msgstr ""
 
-#: src/libpspp/hash.c:614
+#: src/libpspp/hash.c:545
 #, c-format
 msgid "hash table:"
 msgstr ""
@@ -4415,7 +4574,7 @@ msgstr ""
 #: src/output/output.c:719
 #, c-format
 msgid "cannot initialize output driver `%s' of class `%s'"
-msgstr ""
+msgstr "cannot initialise output driver `%s' of class `%s'"
 
 #: src/output/output.c:765
 #, c-format
@@ -4686,7 +4845,7 @@ msgid "Show/hide value labels"
 msgstr ""
 
 #: src/ui/gui/data-editor.c:342 src/ui/gui/data-editor.c:361
-#: src/ui/gui/data-editor.c:1507 src/ui/gui/data-editor.c:1561
+#: src/ui/gui/data-editor.c:1512 src/ui/gui/data-editor.c:1566
 msgid "Clear"
 msgstr ""
 
@@ -4922,7 +5081,7 @@ msgstr ""
 msgid "Weight by %s"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1198 src/ui/gui/data-editor.c:1440
+#: src/ui/gui/data-editor.c:1198 src/ui/gui/data-editor.c:1445
 #: src/ui/gui/data-editor.glade:660
 msgid "Open"
 msgstr ""
@@ -4961,15 +5120,15 @@ msgstr ""
 msgid "Import text data file"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1331 src/ui/gui/data-editor.c:1448
+#: src/ui/gui/data-editor.c:1331 src/ui/gui/data-editor.c:1453
 msgid "System Files (*.sav)"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1337 src/ui/gui/data-editor.c:1454
+#: src/ui/gui/data-editor.c:1337 src/ui/gui/data-editor.c:1459
 msgid "Portable Files (*.por) "
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1343 src/ui/gui/data-editor.c:1460
+#: src/ui/gui/data-editor.c:1343 src/ui/gui/data-editor.c:1465
 #: src/ui/gui/syntax-editor.c:138 src/ui/gui/syntax-editor.c:522
 msgid "All Files"
 msgstr ""
@@ -4982,20 +5141,20 @@ msgstr ""
 msgid "Portable File"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1498
+#: src/ui/gui/data-editor.c:1503
 msgid "Sort Ascending"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1501
+#: src/ui/gui/data-editor.c:1506
 msgid "Sort Descending"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1504 src/ui/gui/data-editor.glade:150
+#: src/ui/gui/data-editor.c:1509 src/ui/gui/data-editor.glade:150
 #: src/ui/gui/data-editor.glade:801
 msgid "Insert Variable"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1558 src/ui/gui/data-editor.glade:789
+#: src/ui/gui/data-editor.c:1563 src/ui/gui/data-editor.glade:789
 msgid "Insert Case"
 msgstr ""
 
@@ -5090,7 +5249,7 @@ msgstr ""
 
 #: src/ui/gui/data-editor.glade:422
 msgid "_Analyze"
-msgstr ""
+msgstr "_Analyse"
 
 #: src/ui/gui/data-editor.glade:432
 msgid "_Descriptive Statistics"
@@ -5136,7 +5295,7 @@ msgstr ""
 #: src/ui/gui/data-editor.glade:611 src/ui/gui/output-viewer.glade:88
 #: src/ui/gui/syntax-editor.glade:243
 msgid "_Minimize All Windows"
-msgstr ""
+msgstr "_Minimise All Windows"
 
 #: src/ui/gui/data-editor.glade:622 src/ui/gui/output-viewer.glade:99
 #: src/ui/gui/syntax-editor.glade:254
@@ -5432,6 +5591,22 @@ msgstr ""
 msgid "Cannot open reference manual: %s"
 msgstr ""
 
+#: src/ui/gui/main.c:42
+msgid "Don't show the splash screen"
+msgstr ""
+
+#: src/ui/gui/main.c:158
+msgid "PSPPIRE --- A user interface for PSPP"
+msgstr ""
+
+#: src/ui/gui/main.c:160
+msgid "Miscellaneous options:"
+msgstr ""
+
+#: src/ui/gui/main.c:162 src/ui/terminal/main.c:126
+msgid "Options affecting syntax and behavior:"
+msgstr "Options affecting syntax and behaviour:"
+
 #: src/ui/gui/message-dialog.c:101
 msgid "data file error"
 msgstr ""
@@ -5595,14 +5770,19 @@ msgstr ""
 msgid "Paste"
 msgstr ""
 
-#: src/ui/gui/psppire.c:194
+#: src/ui/gui/psppire.c:216
 msgid "_Reset"
 msgstr ""
 
-#: src/ui/gui/psppire.c:195
+#: src/ui/gui/psppire.c:217
 msgid "_Select"
 msgstr ""
 
+#: src/ui/gui/psppire.c:253
+#, c-format
+msgid "Cannot open %s: %s.\n"
+msgstr ""
+
 #: src/ui/gui/psppire-data-editor.c:604
 msgid "Data View"
 msgstr ""
@@ -5656,7 +5836,7 @@ msgstr ""
 
 #: src/ui/gui/psppire.glade:452
 msgid "Organize output by groups."
-msgstr ""
+msgstr "Organise output by groups."
 
 #: src/ui/gui/psppire.glade:499
 msgid "Groups based on:"
@@ -6490,60 +6670,62 @@ msgstr ""
 msgid "%s --- PSPP Output"
 msgstr ""
 
-#: src/ui/terminal/command-line.c:230
-#, c-format
+#: src/ui/source-init-opts.c:42
 msgid ""
-"PSPP, a program for statistical analysis of sample data.\n"
-"\n"
-"Usage: %s [OPTION]... FILE...\n"
-"\n"
-"If a long option shows an argument as mandatory, then it is mandatory\n"
-"for the equivalent short option also.  Similarly for optional arguments.\n"
-"\n"
-"Configuration:\n"
-"  -a, --algorithm={compatible|enhanced}\n"
-"                            set to `compatible' if you want output\n"
-"                            calculated from broken algorithms\n"
-"  -B, --config-dir=DIR      set configuration directory to DIR\n"
-"  -o, --device=DEVICE       select output driver DEVICE and disable "
-"defaults\n"
-"\n"
-"Input 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 syntax from stdin, send output to stdout\n"
-"  -I-, --no-include         clear include path\n"
-"  -I, --include=DIR         append DIR to include path\n"
-"\n"
-"Language modifiers:\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"
-"  -x, --syntax={compatible|enhanced}\n"
-"                            set to `compatible' if you want only to accept\n"
-"                            spss compatible syntax\n"
-"\n"
-"Informative output:\n"
-"  -h, --help                print this help, then exit\n"
-"  -l, --list                print a list of known driver classes, then exit\n"
-"  -V, --version             show PSPP version, then exit\n"
-"  -v, --verbose             increments verbosity level\n"
-"\n"
-"Non-option arguments:\n"
-" FILE                       syntax file to execute\n"
-" KEY=VALUE                  overrides macros in output initialization file\n"
-"\n"
+"set to `compatible' if you want output calculated from broken algorithms"
+msgstr ""
+
+#: src/ui/source-init-opts.c:43
+msgid "Append DIR to include path"
 msgstr ""
 
-#: src/ui/terminal/command-line.c:265
+#: src/ui/source-init-opts.c:44
+msgid "Clear include path"
+msgstr ""
+
+#: src/ui/source-init-opts.c:45
+msgid "Disable execution of .pspp/rc at startup"
+msgstr ""
+
+#: src/ui/source-init-opts.c:46
+msgid "Set configuration directory to DIR"
+msgstr ""
+
+#: src/ui/source-init-opts.c:47
+msgid "Don't allow some unsafe operations"
+msgstr ""
+
+#: src/ui/source-init-opts.c:48
+msgid "Set to `compatible' if you want only to accept SPSS compatible syntax"
+msgstr ""
+
+#: src/ui/source-init-opts.c:83
 #, c-format
-msgid ""
-"\n"
-"Report bugs to <%s>.\n"
+msgid "Algorithm must be either \"compatible\" or \"enhanced\"."
+msgstr ""
+
+#: src/ui/source-init-opts.c:124
+#, c-format
+msgid "Syntax must be either \"compatible\" or \"enhanced\"."
+msgstr ""
+
+#: src/ui/terminal/main.c:116
+msgid "PSPP --- A program for statistical analysis"
+msgstr ""
+
+#: src/ui/terminal/main.c:117
+msgid "FILE1, FILE2 ... FILEn"
+msgstr ""
+
+#: src/ui/terminal/main.c:120 src/ui/terminal/terminal-opts.c:177
+msgid "Options affecting input and output locations:"
+msgstr ""
+
+#: src/ui/terminal/main.c:123
+msgid "Diagnositic options:"
 msgstr ""
 
-#: src/ui/terminal/main.c:130
+#: src/ui/terminal/main.c:157
 msgid ""
 "Stopping syntax file processing here to avoid a cascade of dependent command "
 "failures."
@@ -6581,6 +6763,30 @@ msgstr ""
 msgid "could not access definition for terminal `%s'"
 msgstr ""
 
+#: src/ui/terminal/terminal-opts.c:41
+msgid "Increase diagnostic verbosity level"
+msgstr ""
+
+#: src/ui/terminal/terminal-opts.c:68
+msgid "Send error messages to FILE (appended)"
+msgstr ""
+
+#: src/ui/terminal/terminal-opts.c:71
+msgid "Select output driver DEVICE and disable defaults"
+msgstr ""
+
+#: src/ui/terminal/terminal-opts.c:74
+msgid "Print a list of known driver classes, then exit"
+msgstr ""
+
+#: src/ui/terminal/terminal-opts.c:76
+msgid "Start an interactive session"
+msgstr ""
+
+#: src/ui/terminal/terminal-opts.c:178
+msgid "Diagnostic options:"
+msgstr ""
+
 #~ msgid ""
 #~ "   This program is free software: you can redistribute it and/or modify\n"
 #~ "   it under the terms of the GNU General Public License as published by\n"
index f1dde68a56a4febb2fb0f7f82a1d0832c9f4f018..c21b681d1f289f980e8bbcd274c2743726c73275 100644 (file)
@@ -9,9 +9,9 @@ endif
 noinst_LTLIBRARIES += src/ui/libuicommon.la
 
 src_ui_libuicommon_la_SOURCES = \
-       src/ui/debugger.c \
-       src/ui/debugger.h \
-       src/ui/syntax-gen.c \
-       src/ui/syntax-gen.h
+       src/ui/command-line.c src/ui/command-line.h \
+       src/ui/debugger.c src/ui/debugger.h \
+       src/ui/source-init-opts.c src/ui/source-init-opts.h \
+       src/ui/syntax-gen.c src/ui/syntax-gen.h
 
 EXTRA_DIST += src/ui/OChangeLog
diff --git a/src/ui/command-line.c b/src/ui/command-line.c
new file mode 100644 (file)
index 0000000..46dddd4
--- /dev/null
@@ -0,0 +1,166 @@
+/* PSPPIRE - a graphical user interface for PSPP.
+   Copyright (C) 2008  Free Software Foundation
+
+   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
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+
+
+#include <config.h>
+#include "command-line.h"
+#include <argp.h>
+#include <gl/xalloc.h>
+#include <stdlib.h>
+#include <string.h>
+#include <libpspp/compiler.h>
+#include <assert.h>
+
+
+struct clp_child
+{
+  void *aux;
+};
+
+struct command_line_processor
+{
+  struct argp master_parser;
+
+  struct clp_child *child_lookup_table;
+  struct argp_child *children;
+  int n_children;
+
+  const char *doc;
+  const char *args_doc;
+
+  void *aux;
+};
+
+
+/* Convenience function for use in parsing functions.
+   Returns the object for this parser */
+struct command_line_processor *
+get_subject (struct argp_state *state)
+{
+  const struct argp *root = state->root_argp;
+
+  const struct argp_child *children = root->children;
+
+  return  (struct command_line_processor *) children[0].argp;
+}
+
+
+/* Create a command line processor.
+   DOC is typically the name of the program and short description.
+   ARGS_DOC is a short description of the non option arguments.
+   AUX is an arbitrary pointer.
+ */
+struct command_line_processor *
+command_line_processor_create (const char *doc, const char *args_doc, void *aux)
+{
+  struct command_line_processor *clp = xzalloc (sizeof (*clp));
+
+  clp->children = NULL;
+  clp->child_lookup_table = NULL;
+
+  clp->doc = doc;
+  clp->args_doc = args_doc;
+  clp->aux = aux;
+
+  return clp;
+}
+
+/* Destroy a command line processor */
+void
+command_line_processor_destroy (struct command_line_processor *clp)
+{
+  free (clp->children);
+  free (clp->child_lookup_table);
+  free (clp);
+}
+
+
+/* Add a CHILD to the processor CLP, with the doc string DOC.
+   AUX is an auxilliary pointer, specific to CHILD.
+   If AUX is not known or not needed then it may be set to NULL
+*/
+void
+command_line_processor_add_options (struct command_line_processor *clp, const struct argp *child,
+                              const char *doc, void *aux)
+{
+  clp->n_children++;
+
+  clp->children = xrealloc (clp->children, (clp->n_children + 1) * sizeof (*clp->children));
+  memset (&clp->children[clp->n_children - 1], 0, sizeof (*clp->children));
+
+  clp->child_lookup_table = xrealloc (clp->child_lookup_table,
+                                     clp->n_children * sizeof (*clp->child_lookup_table));
+
+  clp->child_lookup_table [clp->n_children - 1].aux = aux;
+
+  clp->children [clp->n_children - 1].argp = child;
+  clp->children [clp->n_children - 1].header = doc;
+  clp->children [clp->n_children].argp = NULL;
+}
+
+
+/* Set the aux paramter for CHILD in CLP to AUX.
+   Any previous value will be overwritten.
+ */
+void
+command_line_processor_replace_aux (struct command_line_processor *clp, const struct argp *child, void *aux)
+{
+  int i;
+  for (i = 0 ; i < clp->n_children; ++i )
+    {
+      if (child->options == clp->children[i].argp->options)
+       {
+         clp->child_lookup_table[i].aux = aux;
+         break;
+       }
+    }
+  assert (i < clp->n_children);
+}
+
+
+static error_t
+top_level_parser (int key UNUSED, char *arg UNUSED, struct argp_state *state)
+{
+  int i;
+  struct command_line_processor *clp = state->input;
+
+  if ( key == ARGP_KEY_INIT)
+    {
+
+      for (i = 0;  i < clp->n_children ; ++i)
+       {
+         state->child_inputs[i] = clp->child_lookup_table[i].aux;
+       }
+    }
+
+  return ARGP_ERR_UNKNOWN;
+}
+
+
+/* Parse the command line specified by (ARGC, ARGV) using CLP */
+void
+command_line_processor_parse (struct command_line_processor *clp, int argc, char **argv)
+{
+  clp->master_parser.parser = top_level_parser;
+  clp->master_parser.args_doc = clp->args_doc;
+
+  clp->master_parser.doc = clp->doc;
+
+  clp->master_parser.children = clp->children;
+
+  argp_parse (&clp->master_parser, argc, argv, 0, 0, clp);
+}
+
diff --git a/src/ui/command-line.h b/src/ui/command-line.h
new file mode 100644 (file)
index 0000000..98edbea
--- /dev/null
@@ -0,0 +1,36 @@
+/* PSPPIRE - a graphical user interface for PSPP.
+   Copyright (C) 2008  Free Software Foundation
+
+   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
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef SRC_UI_COMMAND_LINE_H
+#define SRC_UI_COMMAND_LINE_H
+
+#include <argp.h>
+
+struct command_line_processor;
+
+struct command_line_processor * get_subject (struct argp_state *state);
+
+struct command_line_processor *command_line_processor_create (const char *, const char *, void *);
+
+void command_line_processor_add_options (struct command_line_processor *cla, const struct argp *child, const char *doc, void *aux);
+
+void command_line_processor_replace_aux (struct command_line_processor *cla, const struct argp *child, void *aux);
+
+void command_line_processor_destroy (struct command_line_processor *);
+
+void command_line_processor_parse (struct command_line_processor *, int argc, char **argv);
+
+#endif
index f68f2ad66a24ab3b4a1f774594de76c783dc895a..a36e9410a345557f6c7e9a8ece90b0a15b5aec3d 100644 (file)
 #include "psppire.h"
 #include "progname.h"
 #include <stdlib.h>
-#include <getopt.h>
+#include <argp.h>
 #include <gl/relocatable.h>
+#include <ui/command-line.h>
+#include <ui/source-init-opts.h>
 
 #include <libpspp/version.h>
 #include <libpspp/copyleft.h>
 
-static gboolean parse_command_line (int *argc, char ***argv, gchar **filename,
-                                   gboolean *show_splash, GError **err);
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
 
+const char *argp_program_version = version;
+const char *argp_program_bug_address = PACKAGE_BUGREPORT;
 
+\f
+/* Arguments to be interpreted before the X server gets initialised */
+
+static const struct argp_option startup_options [] =
+  {
+    {"no-splash",  'q',  0,  0,  N_("Don't show the splash screen"), 0 },
+    { 0, 0, 0, 0, 0, 0 }
+  };
+
+static error_t
+parse_startup_opts (int key, char *arg, struct argp_state *state)
+{
+  gboolean *showsplash = state->input;
+
+  switch (key)
+    {
+    case 'q':
+      *showsplash = FALSE;
+      break;
+    default:
+      return ARGP_ERR_UNKNOWN;
+    }
+  return 0;
+}
+
+static const struct argp startup_argp = {startup_options, parse_startup_opts, 0, 0, 0, 0, 0};
+
+\f
 
 static GtkWidget *
 create_splash_window (void)
@@ -72,13 +105,22 @@ quit_one_loop (gpointer data)
   return FALSE;
 }
 
+struct initialisation_parameters
+{
+  int argc;
+  char **argv;
+  GtkWidget *splash_window;
+  struct command_line_processor *clp;
+};
+
 
 static gboolean
 run_inner_loop (gpointer data)
 {
-  initialize ();
+  struct initialisation_parameters *ip = data;
+  initialize (ip->clp, ip->argc, ip->argv);
 
-  g_timeout_add (500, hide_splash_window, data);
+  g_timeout_add (500, hide_splash_window, ip->splash_window);
 
   gtk_main ();
 
@@ -92,10 +134,10 @@ run_inner_loop (gpointer data)
 int
 main (int argc, char *argv[])
 {
-  GtkWidget *splash_window;
-  gchar *filename = 0;
+  struct command_line_processor *clp ;
+  struct initialisation_parameters init_p;
   gboolean show_splash = TRUE;
-  GError *err = 0;
+
   const gchar *vers;
 
   set_program_name (argv[0]);
@@ -113,75 +155,29 @@ main (int argc, char *argv[])
       g_warning (vers);
     }
 
-  /* Deal with options like --version, --help etc */
-  if ( ! parse_command_line (&argc, &argv, &filename, &show_splash, &err) )
-    {
-      g_clear_error (&err);
-      return 0;
-    }
+  clp = command_line_processor_create (_("PSPPIRE --- A user interface for PSPP"), "[ DATA-FILE ]", 0);
+
+  command_line_processor_add_options (clp, &startup_argp, _("Miscellaneous options:"),  &show_splash);
+  command_line_processor_add_options (clp, &post_init_argp,
+                                     _("Options affecting syntax and behavior:"),  NULL);
+  command_line_processor_add_options (clp, &non_option_argp, NULL, NULL);
+
+  command_line_processor_parse (clp, argc, argv);
 
   gdk_init (&argc, &argv);
 
-  splash_window = create_splash_window ();
+  init_p.splash_window = create_splash_window ();
+  init_p.argc = argc;
+  init_p.argv = argv;
+  init_p.clp = clp;
+
   if ( show_splash )
-    gtk_widget_show (splash_window);
+    gtk_widget_show (init_p.splash_window);
 
   g_idle_add (quit_one_loop, 0);
 
-  gtk_quit_add (0, run_inner_loop, splash_window);
+  gtk_quit_add (0, run_inner_loop, &init_p);
   gtk_main ();
 
-
   return 0;
 }
-
-
-/* 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. */
-static gboolean
-parse_command_line (int *argc, char ***argv, gchar **filename,
-                   gboolean *show_splash, GError **err)
-{
-
-  static struct option long_options[] =
-    {
-      {"help", no_argument, NULL, 'h'},
-      {"version", no_argument, NULL, 'V'},
-      {"no-splash", no_argument, NULL, 'q'},
-      {0, 0, 0, 0},
-    };
-
-  int c;
-
-  for (;;)
-    {
-      c = getopt_long (*argc, *argv, "hVq", long_options, NULL);
-      if (c == -1)
-       break;
-
-      switch (c)
-       {
-       case 'h':
-         g_print ("Usage: psppire {|--help|--version|--no-splash}\n");
-          return FALSE;
-       case 'V':
-         g_print (version);
-         g_print ("\n");
-         g_print (legal);
-         return FALSE;
-       case 'q':
-         *show_splash = FALSE;
-         break;
-       default:
-         return FALSE;
-       }
-    }
-
-  if ( optind < *argc)
-    {
-      *filename = (*argv)[optind];
-    }
-
-  return TRUE;
-}
index 0467746333c07960ecef3ae8d984c9182c5109ce..b1551fbb15f137f81cc548cc48f3f49a80f70fb3 100644 (file)
 #include <gsl/gsl_errno.h>
 #include <signal.h>
 
+#include <argp.h>
+#include <ui/command-line.h>
 #include "relocatable.h"
 
 #include "data-editor.h"
 #include "psppire.h"
 
+#include <libpspp/getl.h>
 #include <unistd.h>
 #include <data/casereader.h>
 #include <data/datasheet.h>
@@ -39,6 +42,7 @@
 #include <libpspp/version.h>
 #include <output/output.h>
 #include <output/journal.h>
+#include <language/syntax-string-source.h>
 
 #include <gtk/gtk.h>
 #include <glade/glade.h>
 #include "psppire-data-store.h"
 #include "helper.h"
 #include "message-dialog.h"
+#include <ui/syntax-gen.h>
 
 #include "output-viewer.h"
 
+#include <data/sys-file-reader.h>
+#include <data/por-file-reader.h>
+
+#include <ui/source-init-opts.h>
+
 PsppireDataStore *the_data_store = 0;
 PsppireVarStore *the_var_store = 0;
 
@@ -70,9 +80,8 @@ replace_casereader (struct casereader *s)
 #define _(msgid) gettext (msgid)
 #define N_(msgid) msgid
 
-
 void
-initialize (void)
+initialize (struct command_line_processor *clp, int argc, char **argv)
 {
   PsppireDict *dictionary = 0;
 
@@ -110,6 +119,8 @@ initialize (void)
   the_data_store = psppire_data_store_new (dictionary);
   replace_casereader (NULL);
 
+
+
   create_icon_factory ();
 
   outp_configure_driver_line (
@@ -126,7 +137,14 @@ initialize (void)
   /* Ignore alarm clock signals */
   signal (SIGALRM, SIG_IGN);
 
+  command_line_processor_replace_aux (clp, &post_init_argp, the_source_stream);
+  command_line_processor_replace_aux (clp, &non_option_argp, the_source_stream);
+
+  command_line_processor_parse (clp, argc, argv);
+
   new_data_window (NULL, NULL);
+
+  execute_syntax (create_syntax_string_source (""));
 }
 
 
@@ -201,11 +219,11 @@ create_icon_factory (void)
 
 
     gtk_stock_add (items, 2);
-    gtk_icon_factory_add (factory, "pspp-stock-reset", 
+    gtk_icon_factory_add (factory, "pspp-stock-reset",
                          gtk_icon_factory_lookup_default (GTK_STOCK_REFRESH)
                          );
 
-    gtk_icon_factory_add (factory, "pspp-stock-select", 
+    gtk_icon_factory_add (factory, "pspp-stock-select",
                          gtk_icon_factory_lookup_default (GTK_STOCK_INDEX)
                          );
   }
@@ -213,3 +231,58 @@ create_icon_factory (void)
   gtk_icon_factory_add_default (factory);
 }
 
+\f
+
+static error_t
+parse_non_options (int key, char *arg, struct argp_state *state)
+{
+  struct source_stream *ss = state->input;
+
+  if ( NULL == ss )
+    return 0;
+
+  switch (key)
+    {
+    case ARGP_KEY_ARG:
+      {
+       struct string syntax;
+       FILE *fp = fopen (arg, "r");
+       if (NULL == fp)
+         {
+           const int errnum = errno;
+           fprintf (state->err_stream, _("Cannot open %s: %s.\n"),
+                    arg, strerror (errnum));
+           return 0;
+         }
+       if ( sfm_detect (fp))
+         {
+           ds_init_cstr (&syntax, "GET FILE=");
+           goto close;
+         }
+       rewind (fp);
+       if (pfm_detect (fp))
+         {
+           ds_init_cstr (&syntax, "IMPORT FILE=");
+         }
+      close:
+       fclose (fp);
+
+       syntax_gen_string (&syntax, ss_cstr (arg));
+       ds_put_cstr (&syntax, ".");
+
+       getl_append_source (ss,
+                           create_syntax_string_source (ds_cstr (&syntax)),
+                           GETL_BATCH,
+                           ERRMODE_CONTINUE);
+
+       ds_destroy (&syntax);
+       break;
+      }
+    default:
+      return ARGP_ERR_UNKNOWN;
+    }
+  return 0;
+}
+
+
+const struct argp non_option_argp = {NULL, parse_non_options, 0, 0, 0, 0, 0};
index 9c99af02ea98cca2588660d6c5c0e8aa04cb9fd2..92cd13571ca15bebd63e50adc87eddc385145048 100644 (file)
 #ifndef PSPPIRE_H
 #define PSPPIRE_H
 
+#include <argp.h>
 
-void initialize (void);
+struct command_line_processor ;
+extern const struct argp non_option_argp ;
+
+
+void initialize (struct command_line_processor *, int argc, char **argv);
 void de_initialize (void);
 
 #endif /* PSPPIRE_H */
diff --git a/src/ui/source-init-opts.c b/src/ui/source-init-opts.c
new file mode 100644 (file)
index 0000000..43ae5c6
--- /dev/null
@@ -0,0 +1,136 @@
+/* PSPPIRE - a graphical user interface for PSPP.
+   Copyright (C) 2008  Free Software Foundation
+
+   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
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+#include <argp.h>
+#include "source-init-opts.h"
+#include <stdbool.h>
+#include <xalloc.h>
+#include <string.h>
+#include <output/output.h>
+#include <data/file-name.h>
+#include <libpspp/getl.h>
+#include <language/syntax-file.h>
+#include <stdlib.h>
+#include <libpspp/llx.h>
+#include <data/por-file-reader.h>
+#include <data/sys-file-reader.h>
+#include <libpspp/message.h>
+#include <ui/syntax-gen.h>
+#include <language/syntax-string-source.h>
+#include <data/file-name.h>
+#include <data/settings.h>
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
+
+static const struct argp_option post_init_options [] = {
+  {"algorithm", 'a', "{compatible|enhanced}", 0, N_("set to `compatible' if you want output calculated from broken algorithms"), 0},
+  {"include", 'I', "DIR", 0, N_("Append DIR to include path"), 0},
+  {"no-include", 'I', 0, 0, N_("Clear include path"), 0},
+  {"no-statrc", 'r', 0, 0, N_("Disable execution of .pspp/rc at startup"), 0},
+  {"config-dir", 'B', "DIR", 0, N_("Set configuration directory to DIR"), 0},
+  {"safer", 's', 0, 0,  N_("Don't allow some unsafe operations"), 0},
+  {"syntax", 'x', "{compatible|enhanced}", 0, N_("Set to `compatible' if you want only to accept SPSS compatible syntax"), 0},
+  { 0, 0, 0, 0, 0, 0 }
+};
+
+static error_t
+parse_post_init_opts (int key, char *arg, struct argp_state *state)
+{
+  struct source_init
+  {
+    bool process_statrc;
+  };
+
+  struct source_init *sip = state->hook;
+
+  struct source_stream *ss = state->input;
+
+  if ( state->input == NULL)
+    return 0;
+
+  switch (key)
+    {
+    case ARGP_KEY_INIT:
+      state->hook = sip = xzalloc (sizeof (struct source_init));
+      sip->process_statrc = true;
+      break;
+    case ARGP_KEY_FINI:
+      free (sip);
+      break;
+    case  'a':
+      if ( 0 == strcmp (arg, "compatible") )
+       settings_set_algorithm (COMPATIBLE);
+      else if ( 0 == strcmp (arg, "enhanced"))
+       settings_set_algorithm (ENHANCED);
+      else
+       {
+         argp_failure (state, 1, 0, _("Algorithm must be either \"compatible\" or \"enhanced\"."));
+       }
+      break;
+    case 'B':
+      config_path = arg;
+      break;
+    case 'I':
+      if (arg == NULL || !strcmp (arg, "-"))
+       getl_clear_include_path (ss);
+      else
+       getl_add_include_dir (ss, arg);
+      break;
+    case 'r':
+      sip->process_statrc = false;
+      break;
+    case ARGP_KEY_SUCCESS:
+      if (sip->process_statrc)
+       {
+         char *pspprc_fn = fn_search_path ("rc", config_path);
+         if (pspprc_fn != NULL)
+           {
+             getl_append_source (ss,
+                                 create_syntax_file_source (pspprc_fn),
+                                 GETL_BATCH,
+                                 ERRMODE_CONTINUE
+                                 );
+
+             free (pspprc_fn);
+           }
+       }
+      break;
+    case 's':
+      settings_set_safer_mode ();
+      break;
+    case 'x':
+      if ( 0 == strcmp (arg, "compatible") )
+       settings_set_syntax (COMPATIBLE);
+      else if ( 0 == strcmp (arg, "enhanced"))
+       settings_set_syntax (ENHANCED);
+      else
+       {
+         argp_failure (state, 1, 0, _("Syntax must be either \"compatible\" or \"enhanced\"."));
+       }
+      break;
+    default:
+      return ARGP_ERR_UNKNOWN;
+    }
+
+  return 0;
+}
+
+const struct argp post_init_argp =
+  {post_init_options, parse_post_init_opts, 0, 0, 0, 0, 0};
+
diff --git a/src/ui/source-init-opts.h b/src/ui/source-init-opts.h
new file mode 100644 (file)
index 0000000..8749353
--- /dev/null
@@ -0,0 +1,24 @@
+/* PSPPIRE - a graphical user interface for PSPP.
+   Copyright (C) 2008  Free Software Foundation
+
+   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
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+
+
+#ifndef SOURCE_INIT_OPTS
+#define SOURCE_INIT_OPTS
+
+extern const struct argp post_init_argp;
+
+#endif
+
index 988f24d5d3828f52786929791f90960a25d17dd3..598cdddd8eefaeea38196d188be9e33baeda36f0 100644 (file)
@@ -3,15 +3,16 @@
 noinst_LTLIBRARIES += src/ui/terminal/libui.la
 
 src_ui_terminal_libui_la_SOURCES = \
-       src/ui/terminal/command-line.c \
-       src/ui/terminal/command-line.h \
        src/ui/terminal/read-line.c \
        src/ui/terminal/read-line.h \
        src/ui/terminal/main.c \
        src/ui/terminal/msg-ui.c \
        src/ui/terminal/msg-ui.h \
        src/ui/terminal/terminal.c \
-       src/ui/terminal/terminal.h      
+       src/ui/terminal/terminal.h \
+       src/ui/terminal/terminal-opts.c \
+       src/ui/terminal/terminal-opts.h 
+
 
 src_ui_terminal_libui_la_CFLAGS = -DINSTALLDIR=\"$(bindir)\" $(NCURSES_CFLAGS)
 
diff --git a/src/ui/terminal/command-line.c b/src/ui/terminal/command-line.c
deleted file mode 100644 (file)
index 95b22ce..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-/* PSPP - a program for statistical analysis.
-   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
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-#include "command-line.h"
-#include "msg-ui.h"
-#include <libpspp/message.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <errno.h>
-#include <getopt.h>
-#include <stdlib.h>
-#include <libpspp/assertion.h>
-#include <libpspp/copyleft.h>
-#include <libpspp/message.h>
-#include <language/syntax-file.h>
-#include "progname.h"
-#include <data/settings.h>
-#include <output/output.h>
-#include <data/file-name.h>
-#include <libpspp/getl.h>
-#include <libpspp/str.h>
-#include <libpspp/version.h>
-#include <libpspp/verbose-msg.h>
-#include "read-line.h"
-
-#include "xalloc.h"
-
-#include "gettext.h"
-#define _(msgid) gettext (msgid)
-#define N_(msgid) msgid
-
-static void usage (void);
-
-/* 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, struct source_stream *ss)
-{
-  static struct option long_options[] =
-  {
-    {"algorithm", required_argument, NULL, 'a'},
-    {"command", required_argument, NULL, 'c'},
-    {"config-directory", required_argument, NULL, 'B'},
-    {"device", required_argument, NULL, 'o'},
-    {"dry-run", no_argument, NULL, 'n'},
-    {"edit", no_argument, NULL, 'n'},
-    {"error-file", required_argument, NULL, 'e'},
-    {"help", no_argument, NULL, 'h'},
-    {"include-directory", required_argument, NULL, 'I'},
-    {"interactive", no_argument, NULL, 'i'},
-    {"just-print", no_argument, NULL, 'n'},
-    {"list", no_argument, NULL, 'l'},
-    {"no-include", no_argument, NULL, 'I'},
-    {"no-statrc", no_argument, NULL, 'r'},
-    {"out-file", required_argument, NULL, 'f'},
-    {"pipe", no_argument, NULL, 'p'},
-    {"recon", no_argument, NULL, 'n'},
-    {"safer", no_argument, NULL, 's'},
-    {"syntax", required_argument, NULL, 'x'},
-    {"testing-mode", no_argument, NULL, 'T'},
-    {"verbose", no_argument, NULL, 'v'},
-    {"version", no_argument, NULL, 'V'},
-    {0, 0, 0, 0},
-  };
-
-  int c, i;
-
-  bool cleared_device_defaults = false;
-  bool process_statrc = true;
-  bool interactive_mode = false;
-  int syntax_files = 0;
-
-  for (;;)
-    {
-      c = getopt_long (argc, argv, "a:x:B:c:e:f:hiI:lno:prsvV", long_options, NULL);
-      if (c == -1)
-       break;
-
-      switch (c)
-       {
-         /* Compatibility options */
-        case 'a':
-         if ( 0 == strcmp(optarg,"compatible") )
-             settings_set_algorithm(COMPATIBLE);
-         else if ( 0 == strcmp(optarg,"enhanced"))
-             settings_set_algorithm(ENHANCED);
-         else
-           {
-             usage ();
-              return false;
-           }
-         break;
-
-       case 'x':
-         if ( 0 == strcmp(optarg,"compatible") )
-           settings_set_syntax (COMPATIBLE);
-         else if ( 0 == strcmp(optarg,"enhanced"))
-           settings_set_syntax (ENHANCED);
-         else
-           {
-             usage ();
-              return false;
-           }
-         break;
-       case 'e':
-         msg_ui_set_error_file (optarg);
-         break;
-       case 'B':
-         config_path = optarg;
-         break;
-       case 'f':
-         printf (_("%s is not yet implemented."), "-f");
-          putchar('\n');
-         break;
-       case 'h':
-         usage ();
-          return false;
-       case 'i':
-         interactive_mode = true;
-         break;
-       case 'I':
-         if (optarg == NULL || !strcmp (optarg, "-"))
-           getl_clear_include_path (ss);
-         else
-           getl_add_include_dir (ss, optarg);
-         break;
-       case 'l':
-         outp_list_classes ();
-          return false;
-       case 'n':
-         printf (_("%s is not yet implemented."),"-n");
-          putchar('\n');
-         break;
-       case 'o':
-         if (!cleared_device_defaults)
-           {
-             outp_configure_clear ();
-             cleared_device_defaults = true;
-           }
-         outp_configure_add (optarg);
-         break;
-       case 'p':
-         printf (_("%s is not yet implemented."),"-p");
-          putchar('\n');
-         break;
-       case 'r':
-         process_statrc = false;
-         break;
-       case 's':
-         settings_set_safer_mode ();
-         break;
-       case 'v':
-         verbose_increment_level ();
-         break;
-       case 'V':
-         puts (version);
-         puts (legal);
-         return false;
-        case 'T':
-          settings_set_testing_mode (true);
-          break;
-       case '?':
-         usage ();
-          return false;
-       case 0:
-         break;
-       default:
-         NOT_REACHED ();
-       }
-    }
-
-  if (process_statrc)
-    {
-      char *pspprc_fn = fn_search_path ("rc", config_path);
-      if (pspprc_fn != NULL)
-        {
-         getl_append_source (ss,
-                             create_syntax_file_source (pspprc_fn),
-                             GETL_BATCH,
-                             ERRMODE_CONTINUE
-                             );
-
-          free (pspprc_fn);
-        }
-    }
-
-  for (i = optind; i < argc; i++)
-    if (strchr (argv[i], '='))
-      outp_configure_macro (argv[i]);
-    else
-      {
-       getl_append_source (ss,
-                           create_syntax_file_source (argv[i]),
-                           GETL_BATCH,
-                           ERRMODE_CONTINUE
-                           );
-        syntax_files++;
-      }
-
-  if (!syntax_files || interactive_mode)
-    {
-      getl_append_source (ss, create_readln_source (),
-                         GETL_INTERACTIVE,
-                         ERRMODE_CONTINUE
-                         );
-      if (!cleared_device_defaults)
-        outp_configure_add ("interactive");
-    }
-
-  return true;
-}
-
-/* Message that describes PSPP command-line syntax. */
-static const char pre_syntax_message[] =
-N_("PSPP, a program for statistical analysis of sample data.\n"
-"\nUsage: %s [OPTION]... FILE...\n"
-"\nIf a long option shows an argument as mandatory, then it is mandatory\n"
-"for the equivalent short option also.  Similarly for optional arguments.\n"
-"\nConfiguration:\n"
-"  -a, --algorithm={compatible|enhanced}\n"
-"                            set to `compatible' if you want output\n"
-"                            calculated from broken algorithms\n"
-"  -B, --config-dir=DIR      set configuration directory to DIR\n"
-"  -o, --device=DEVICE       select output driver DEVICE and disable defaults\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 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 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"
-"  -x, --syntax={compatible|enhanced}\n"
-"                            set to `compatible' if you want only to accept\n"
-"                            spss compatible syntax\n"
-"\nInformative output:\n"
-"  -h, --help                print this help, then exit\n"
-"  -l, --list                print a list of known driver classes, then exit\n"
-"  -V, --version             show PSPP version, then exit\n"
-"  -v, --verbose             increments verbosity level\n"
-"\nNon-option arguments:\n"
-" FILE                       syntax file to execute\n"
-" KEY=VALUE                  overrides macros in output initialization file\n"
-"\n");
-
-/* Message that describes PSPP command-line syntax, continued. */
-static const char post_syntax_message[] = N_("\nReport bugs to <%s>.\n");
-
-/* Writes a syntax description to stdout. */
-static void
-usage (void)
-{
-  printf (gettext (pre_syntax_message), program_name);
-  outp_list_classes ();
-  printf (gettext (post_syntax_message), PACKAGE_BUGREPORT);
-}
diff --git a/src/ui/terminal/command-line.h b/src/ui/terminal/command-line.h
deleted file mode 100644 (file)
index 601c73c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-9, 2000 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
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
-
-#if !INCLUDED_CMDLINE_H
-#define INCLUDED_CMDLINE_H 1
-
-#include <stdbool.h>
-
-struct source_stream ;
-
-bool parse_command_line (int argc, char **argv, struct source_stream *);
-
-#endif /* cmdline.h */
index e91677b36109c2a84b76a782179bd71710608a07..904c9a1dbc772bb1bcbf33d591124da8a41db9b6 100644 (file)
 #include <math/random.h>
 #include <output/output.h>
 #include <ui/debugger.h>
-#include <ui/terminal/command-line.h>
 #include <ui/terminal/msg-ui.h>
 #include <ui/terminal/read-line.h>
 #include <ui/terminal/terminal.h>
+#include <ui/terminal/terminal-opts.h>
+#include <ui/command-line.h>
+#include <ui/source-init-opts.h>
 
 #include "fatal-signal.h"
 #include "progname.h"
@@ -73,12 +75,15 @@ static struct dataset * the_dataset = NULL;
 static struct lexer *the_lexer;
 static struct source_stream *the_source_stream ;
 
+const char *argp_program_version = version;
+const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+
 /* Program entry point. */
 int
 main (int argc, char **argv)
 {
   int *view_width_p, *view_length_p;
-
+  struct command_line_processor *clp;
   set_program_name (argv[0]);
 
   signal (SIGABRT, bug_handler);
@@ -106,37 +111,58 @@ main (int argc, char **argv)
 
   the_dataset = create_dataset ();
 
-  if (parse_command_line (argc, argv, the_source_stream))
+
+
+  clp = command_line_processor_create (_("PSPP --- A program for statistical analysis"),
+                                      _("FILE1, FILE2 ... FILEn"), NULL);
+
+  command_line_processor_add_options (clp, &io_argp,
+                                     _("Options affecting input and output locations:"), the_source_stream);
+
+  command_line_processor_add_options (clp, &test_argp,
+                                     _("Diagnositic options:"), the_source_stream);
+
+  command_line_processor_add_options (clp, &post_init_argp,
+                                     _("Options affecting syntax and behavior:"), the_source_stream);
+
+  command_line_processor_parse (clp, argc, argv);
+
+  msg_ui_init (the_source_stream);
+
+  if (!settings_get_testing_mode ())
+    {
+      outp_read_devices ();
+    }
+  else
+    {
+      outp_configure_driver_line
+       (
+        ss_cstr ("raw-ascii:ascii:listing:width=9999 length=9999 "
+                 "output-file=\"pspp.list\" emphasis=none "
+                 "headers=off paginate=off squeeze=on "
+                 "top-margin=0 bottom-margin=0"));
+    }
+
+  the_lexer = lex_create (the_source_stream);
+
+  for (;;)
     {
-      msg_ui_init (the_source_stream);
-      if (!settings_get_testing_mode ())
-        outp_read_devices ();
+      int result = cmd_parse (the_lexer, the_dataset);
+
+      if (result == CMD_EOF || result == CMD_FINISH)
+       break;
+      if (result == CMD_CASCADING_FAILURE &&
+         !getl_is_interactive (the_source_stream))
+       {
+         msg (SE, _("Stopping syntax file processing here to avoid "
+                    "a cascade of dependent command failures."));
+         getl_abort_noninteractive (the_source_stream);
+       }
       else
-        outp_configure_driver_line (
-          ss_cstr ("raw-ascii:ascii:listing:width=9999 length=9999 "
-                   "output-file=\"pspp.list\" emphasis=none "
-                   "headers=off paginate=off squeeze=on "
-                   "top-margin=0 bottom-margin=0"));
-      the_lexer = lex_create (the_source_stream);
-
-      for (;;)
-        {
-          int result = cmd_parse (the_lexer, the_dataset);
-
-          if (result == CMD_EOF || result == CMD_FINISH)
-            break;
-          if (result == CMD_CASCADING_FAILURE &&
-             !getl_is_interactive (the_source_stream))
-            {
-              msg (SE, _("Stopping syntax file processing here to avoid "
-                         "a cascade of dependent command failures."));
-              getl_abort_noninteractive (the_source_stream);
-            }
-          else
-            check_msg_count (the_source_stream);
-        }
+       check_msg_count (the_source_stream);
     }
 
+
   clean_up ();
   return any_errors ();
 }
diff --git a/src/ui/terminal/terminal-opts.c b/src/ui/terminal/terminal-opts.c
new file mode 100644 (file)
index 0000000..d2ddc6e
--- /dev/null
@@ -0,0 +1,198 @@
+/* PSPPIRE - a graphical user interface for PSPP.
+   Copyright (C) 2008  Free Software Foundation
+
+   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
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+#include <argp.h>
+#include <stdbool.h>
+#include <xalloc.h>
+#include <stdlib.h>
+#include <data/settings.h>
+#include <output/output.h>
+#include "msg-ui.h"
+#include <ui/command-line.h>
+#include <libpspp/verbose-msg.h>
+#include <libpspp/llx.h>
+#include <data/file-name.h>
+#include "terminal-opts.h"
+#include <libpspp/getl.h>
+#include <language/syntax-file.h>
+#include "read-line.h"
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
+
+
+static const struct argp_option test_options [] =
+  {
+    {"verbose", 'v', 0, 0, N_("Increase diagnostic verbosity level"), 0},
+    {"testing-mode", 'T', 0, OPTION_HIDDEN, 0, 0},
+
+    { 0, 0, 0, 0, 0, 0 }
+  };
+
+static error_t
+parse_test_opts (int key, char *arg, struct argp_state *state)
+{
+  switch (key)
+    {
+    case 'T':
+      settings_set_testing_mode (true);
+      break;
+    case 'v':
+      verbose_increment_level ();
+      break;
+    default:
+      return ARGP_ERR_UNKNOWN;
+    }
+
+  return 0;
+}
+
+static const struct argp_option io_options [] =
+  {
+    {"error-file", 'e', "FILE", 0,
+     N_("Send error messages to FILE (appended)"), 0},
+
+    {"device", 'o', "DEVICE", 0,
+     N_("Select output driver DEVICE and disable defaults"), 0},
+
+    {"list", 'l', 0, 0,
+     N_("Print a list of known driver classes, then exit"), 0},
+
+    {"interactive", 'i', 0, 0, N_("Start an interactive session"), 0},
+
+    { 0, 0, 0, 0, 0, 0 }
+  };
+
+
+static error_t
+parse_io_opts (int key, char *arg, struct argp_state *state)
+{
+  struct source_init
+  {
+    struct llx_list file_list;
+    bool cleared_device_defaults;
+    bool interactive;
+  };
+
+  struct fn_element {
+    struct ll ll;
+    const char *fn;
+  };
+
+  struct source_init *sip = state->hook;
+
+  struct source_stream *ss = state->input;
+
+  struct command_line_processor *clp = get_subject (state);
+
+  switch (key)
+    {
+    case ARGP_KEY_INIT:
+      state->hook = sip = xzalloc (sizeof (struct source_init));
+      llx_init (&sip->file_list);
+      break;
+    case ARGP_KEY_ARG:
+      if (strchr (arg, '='))
+       outp_configure_macro (arg);
+      else
+       {
+         llx_push_tail (&sip->file_list, arg, &llx_malloc_mgr);
+       }
+      break;
+    case ARGP_KEY_SUCCESS:
+      {
+      struct llx *llx = llx_null (&sip->file_list);
+      while ((llx = llx_next (llx)) != llx_null (&sip->file_list))
+       {
+         const char *fn = llx_data (llx);
+         /* Assume it's a syntax file */
+         getl_append_source (ss,
+                             create_syntax_file_source (fn),
+                             GETL_BATCH,
+                             ERRMODE_CONTINUE
+                             );
+
+       }
+
+      if (sip->interactive || llx_is_empty (&sip->file_list))
+       {
+         getl_append_source (ss, create_readln_source (),
+                             GETL_INTERACTIVE,
+                             ERRMODE_CONTINUE
+                             );
+
+         if (!sip->cleared_device_defaults)
+           outp_configure_add ("interactive");
+       }
+      }
+      break;
+    case ARGP_KEY_FINI:
+      free (sip);
+      break;
+    case 'e':
+      msg_ui_set_error_file (arg);
+      break;
+    case 'i':
+      sip->interactive = true;
+      break;
+    case 'l':
+      outp_list_classes ();
+      break;
+    case 'o':
+      if (! sip->cleared_device_defaults)
+       {
+         outp_configure_clear ();
+         sip->cleared_device_defaults = true;
+       }
+      outp_configure_add (arg);
+      break;
+    default:
+      return ARGP_ERR_UNKNOWN;
+    }
+
+  return 0;
+}
+
+const struct argp io_argp =  {io_options, parse_io_opts, 0, 0, 0, 0, 0};
+const struct argp test_argp =  {test_options, parse_test_opts, 0, 0, 0, 0, 0};
+
+#if 0
+static const struct argp_child children [] =
+  {
+    {&io_argp, 0, N_("Options affecting input and output locations:"), 0},
+    {&test_argp, 0, N_("Diagnostic options:"), 0},
+    {0, 0, 0, 0}
+  };
+
+
+static error_t
+propagate_aux (int key, char *arg, struct argp_state *state)
+{
+  if ( key == ARGP_KEY_INIT)
+    {
+      int i;
+      for (i = 0 ; i < sizeof (children) / sizeof (children[0]) - 1 ; ++i)
+       state->child_inputs[i] = state->input;
+    }
+
+  return ARGP_ERR_UNKNOWN;
+}
+
+const struct argp terminal_argp =  {NULL, propagate_aux, 0, 0, children, 0, 0};
+
+#endif
diff --git a/src/ui/terminal/terminal-opts.h b/src/ui/terminal/terminal-opts.h
new file mode 100644 (file)
index 0000000..e5d032d
--- /dev/null
@@ -0,0 +1,27 @@
+/* PSPPIRE - a graphical user interface for PSPP.
+   Copyright (C) 2008  Free Software Foundation
+
+   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
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+
+
+#ifndef TERMINAL_OPTS
+#define TERMINAL_OPTS
+
+extern const struct argp io_argp ;
+extern const struct argp test_argp ;
+
+extern const struct argp terminal_argp;
+
+#endif
+