From: Ben Pfaff Date: Thu, 3 Jun 2010 05:02:42 +0000 (-0700) Subject: pspp: Add --no-output option to allow entirely disabling output. X-Git-Tag: sav-api~203 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=d01297fc4e5e2c48ca66c00cd78569217a5b5bc1 pspp: Add --no-output option to allow entirely disabling output. --- diff --git a/doc/invoking.texi b/doc/invoking.texi index 830d176463..be89ace610 100644 --- a/doc/invoking.texi +++ b/doc/invoking.texi @@ -41,6 +41,7 @@ corresponding short options. -O @var{option}=@var{value} -O format=@var{format} -O device=@{terminal|listing@} +--no-output -e, --error-file=@var{error-file} @end example @@ -106,6 +107,11 @@ SET command's output routing subcommands (@pxref{SET}). By default, output written to standard output is considered a terminal device and other output is considered a listing device. +@item --no-output +Disables output entirely, if neither @option{-o} nor @option{-O} is +also used. If one of those options is used, @option{--no-output} has +no effect. + @item -e @var{error-file} @itemx --error-file=@var{error-file} Configures a file to receive PSPP error, warning, and note messages in diff --git a/src/ui/terminal/terminal-opts.c b/src/ui/terminal/terminal-opts.c index d1296a3625..306ebe1523 100644 --- a/src/ui/terminal/terminal-opts.c +++ b/src/ui/terminal/terminal-opts.c @@ -68,6 +68,7 @@ enum OPT_ERROR_FILE, OPT_OUTPUT, OPT_OUTPUT_OPTION, + OPT_NO_OUTPUT, OPT_INTERACTIVE, OPT_NO_STATRC, OPT_HELP, @@ -81,6 +82,7 @@ static struct argv_option terminal_argv_options[N_TERMINAL_OPTIONS] = {"error-file", 'e', required_argument, OPT_ERROR_FILE}, {"output", 'o', required_argument, OPT_OUTPUT}, {NULL, 'O', required_argument, OPT_OUTPUT_OPTION}, + {"no-output", 0, no_argument, OPT_NO_OUTPUT}, {"interactive", 'i', no_argument, OPT_INTERACTIVE}, {"no-statrc", 'r', no_argument, OPT_NO_STATRC}, {"help", 'h', no_argument, OPT_HELP}, @@ -195,6 +197,7 @@ Output options:\n\ -O OPTION=VALUE set output option to customize previous -o\n\ -O device={terminal|listing} override device type for previous -o\n\ -e, --error-file=FILE append errors, warnings, and notes to FILE\n\ + --no-output disable default output driver\n\ Supported output formats: %s\n\ \n\ Language options:\n\ @@ -249,6 +252,12 @@ terminal_option_callback (int id, void *to_) parse_output_option (to, optarg); break; + case OPT_NO_OUTPUT: + /* Pretend that we already have an output driver, which disables adding + one in terminal_opts_done() when we don't already have one. */ + to->has_output_driver = true; + break; + case OPT_INTERACTIVE: to->syntax_mode = GETL_INTERACTIVE; break;