Use @samp{-} as @var{output-file} to write output to standard output.
-If no @option{-o} option is used, then @pspp{} writes output to standard
-output in plain text format.
+If no @option{-o} option is used, then @pspp{} writes text and CSV
+output to standard output and other kinds of output to whose name is
+based on the format, e.g.@: @file{pspp.pdf} for PDF output.
@item @option{-O @var{option}=@var{value}}
Sets an option for the output file configured by a preceding
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2011, 2012 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
}
const struct output_driver_factory txt_driver_factory =
- { "txt", ascii_create };
+ { "txt", "-", ascii_create };
const struct output_driver_factory list_driver_factory =
- { "list", ascii_create };
+ { "list", "-", ascii_create };
static const struct output_driver_class ascii_driver_class =
{
xr_draw_cell (xr, &cell, bb, bb);
}
\f
-struct output_driver_factory pdf_driver_factory = { "pdf", xr_pdf_create };
-struct output_driver_factory ps_driver_factory = { "ps", xr_ps_create };
-struct output_driver_factory svg_driver_factory = { "svg", xr_svg_create };
+struct output_driver_factory pdf_driver_factory =
+ { "pdf", "pspp.pdf", xr_pdf_create };
+struct output_driver_factory ps_driver_factory =
+ { "ps", "pspp.ps", xr_ps_create };
+struct output_driver_factory svg_driver_factory =
+ { "svg", "pspp.svg", xr_svg_create };
static const struct output_driver_class cairo_driver_class =
{
/* PSPP - a program for statistical analysis.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2012 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
}
}
-struct output_driver_factory csv_driver_factory = { "csv", csv_create };
+struct output_driver_factory csv_driver_factory = { "csv", "-", csv_create };
static const struct output_driver_class csv_driver_class =
{
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2012 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 file extension, without the leading dot, e.g. "pdf". */
const char *extension;
+ /* The default file name, including extension.
+
+ If this is "-", that implies that by default output will be directed to
+ stdout. */
+ const char *default_file_name;
+
/* Creates a new output driver of this class. NAME and TYPE should be
passed directly to output_driver_init. Returns the new output driver if
successful, otherwise a null pointer.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2011, 2012 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
char *file_name;
char *format;
+ format = string_map_find_and_delete (options, "format");
file_name = string_map_find_and_delete (options, "output-file");
- if (file_name == NULL)
- file_name = xstrdup ("-");
- format = string_map_find_and_delete (options, "format");
if (format == NULL)
{
- const char *extension = strrchr (file_name, '.');
- format = xstrdup (extension != NULL ? extension + 1 : "");
+ if (file_name != NULL)
+ {
+ const char *extension = strrchr (file_name, '.');
+ format = xstrdup (extension != NULL ? extension + 1 : "");
+ }
+ else
+ format = xstrdup ("txt");
}
+ f = find_factory (format);
+
+ if (file_name == NULL)
+ file_name = xstrdup (f->default_file_name);
/* XXX should use parse_enum(). */
device_string = string_map_find_and_delete (options, "device");
device_type = default_device_type (file_name);
}
- f = find_factory (format);
driver = f->create (file_name, device_type, options);
if (driver != NULL)
{
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012 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
fputs ("</TABLE>\n\n", html->file);
}
-struct output_driver_factory html_driver_factory = { "html", html_create };
+struct output_driver_factory html_driver_factory =
+ { "html", "pspp.html", html_create };
static const struct output_driver_class html_driver_class =
{
/* PSPP - a program for statistical analysis.
- Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2011, 2012 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
}
}
-struct output_driver_factory odt_driver_factory = { "odt", odt_create };
+struct output_driver_factory odt_driver_factory =
+ { "odt", "pspp.odf", odt_create };
static const struct output_driver_class odt_driver_class =
{