X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utilities%2Fpspp-output.c;h=5ffb45388771e26a41c54715e125d5262086d4fa;hb=64924ffc331a0aca047bf79d40b454c4da8f9021;hp=56a46f001d876c835936ecc172041730b3006197;hpb=f8659933d48c5682010d1e1f04ae7acb5cbcd611;p=pspp diff --git a/utilities/pspp-output.c b/utilities/pspp-output.c index 56a46f001d..5ffb453887 100644 --- a/utilities/pspp-output.c +++ b/utilities/pspp-output.c @@ -16,9 +16,7 @@ #include -#ifdef HAVE_CAIRO #include -#endif #include #include #include @@ -61,7 +59,7 @@ static struct string_map output_options = STRING_MAP_INITIALIZER (output_options); -/* --member-name: Include .zip member name in "dir" output. */ +/* --member-names: Include .zip member name in "dir" output. */ static bool show_member_names; /* --show-hidden, --select, --commands, ...: Selection criteria. */ @@ -87,6 +85,7 @@ static struct pivot_table_look *table_look; static size_t n_warnings; static void usage (void); +static void developer_usage (void); static void parse_options (int argc, char **argv); static void @@ -126,10 +125,8 @@ dump_item (const struct spv_item *item) break; case SPV_ITEM_IMAGE: -#ifdef HAVE_CAIRO image_item_submit (image_item_create (cairo_surface_reference ( spv_item_get_image (item)))); -#endif break; case SPV_ITEM_TREE: @@ -516,6 +513,9 @@ run_dump_legacy_data (int argc UNUSED, char **argv) if (err) error (1, 0, "%s", err); + if (raw && isatty (STDOUT_FILENO)) + error (1, 0, "not writing binary data to tty"); + struct spv_item **items; size_t n_items; spv_select (spv, criteria, n_criteria, &items, &n_items); @@ -651,7 +651,7 @@ dump_xml (int argc, char **argv, const char *member_name, xmlXPathFreeContext (xpath_ctx); } if (any_results) - putchar ('\n');; + putchar ('\n'); } xmlFreeDoc (doc); } @@ -992,6 +992,7 @@ parse_options (int argc, char *argv[]) OPT_SORT, OPT_RAW, OPT_TABLE_LOOK, + OPT_HELP_DEVELOPER, }; static const struct option long_options[] = { @@ -1019,6 +1020,7 @@ parse_options (int argc, char *argv[]) { "raw", no_argument, NULL, OPT_RAW }, { "help", no_argument, NULL, 'h' }, + { "help-developer", no_argument, NULL, OPT_HELP_DEVELOPER }, { "version", no_argument, NULL, 'v' }, { NULL, 0, NULL, 0 }, @@ -1105,6 +1107,10 @@ parse_options (int argc, char *argv[]) usage (); exit (EXIT_SUCCESS); + case OPT_HELP_DEVELOPER: + developer_usage (); + exit (EXIT_SUCCESS); + default: exit (EXIT_FAILURE); } @@ -1158,7 +1164,32 @@ The following options override \"convert\" behavior:\n\ --table-look=FILE override tables' style with TableLook from FILE\n\ Other options:\n\ --help display this help and exit\n\ + --help-developer display help for developer commands and exit\n\ --version output version information and exit\n", program_name, program_name, ds_cstr (&s)); ds_destroy (&s); } + +static void +developer_usage (void) +{ + printf ("\ +The following developer commands are available:\n\ + dump FILE Dump pivot table structure\n\ + [--raw | --sort] dump-light-table FILE Dump light tables\n\ + [--raw] dump-legacy-data FILE Dump legacy table data\n\ + dump-legacy-table FILE [XPATH]... Dump legacy table XML\n\ + dump-structure FILE [XPATH]... Dump structure XML\n\ + is-legacy FILE Exit with status 0 if any legacy table selected\n\ +\n\ +Additional input selection options:\n\ + --members=MEMBER... include only objects with these Zip member names\n\ + --errors include only objects that cannot be loaded\n\ +\n\ +Additional options for \"dir\" command:\n\ + --member-names show Zip member names with objects\n\ +\n\ +Other options:\n\ + --raw print raw binary data instead of a parsed version\n\ + --sort sort borders and areas for shorter \"diff\" output\n"); +}