#include "output/spv/spv-legacy-data.h"
#include "output/spv/spv-output.h"
#include "output/spv/spv-select.h"
+#include "output/spv/spv-table-look.h"
#include "output/spv/spv.h"
#include "output/table-item.h"
#include "output/text-item.h"
/* -f, --force: Keep output file even on error. */
static bool force;
+/* --table-look: TableLook to replace table style for conversion. */
+static struct spv_table_look *table_look;
+
/* Number of warnings issued. */
static size_t n_warnings;
if (err)
error (1, 0, "%s", err);
+ if (table_look)
+ spv_item_set_table_look (spv_get_root (spv), table_look);
+
output_engine_push ();
output_set_filename (argv[1]);
string_map_replace (&output_options, "output-file", argv[2]);
c->run (argc, argv);
+ spv_table_look_destroy (table_look);
i18n_done ();
return n_warnings ? EXIT_FAILURE : EXIT_SUCCESS;
string_array_parse (&cm->members, ss_cstr (arg), ss_cstr (","));
}
+static void
+parse_table_look (const char *arg)
+{
+ spv_table_look_destroy (table_look);
+ char *error_s = spv_table_look_read (arg, &table_look);
+ if (error_s)
+ error (1, 0, "%s", error_s);
+}
+
static void
parse_options (int argc, char *argv[])
{
OPT_OR,
OPT_SORT,
OPT_RAW,
+ OPT_TABLE_LOOK,
};
static const struct option long_options[] =
{
/* "convert" command options. */
{ "force", no_argument, NULL, 'f' },
+ { "table-look", required_argument, NULL, OPT_TABLE_LOOK },
/* "dump-light-table" command options. */
{ "sort", no_argument, NULL, OPT_SORT },
raw = true;
break;
+ case OPT_TABLE_LOOK:
+ parse_table_look (optarg);
+ break;
+
case 'f':
force = true;
break;
-O format=FORMAT set destination format to FORMAT\n\
-O OPTION=VALUE set output option\n\
-f, --force keep output file even given errors\n\
+ --table-look=FILE override tables' style with TableLook from FILE\n\
Other options:\n\
--help display this help and exit\n\
--version output version information and exit\n",