From 9898e02ae6a6141432cc69b489cec62a6861acab Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Mon, 27 Jul 2015 16:13:31 +0300 Subject: Add debug print on CSV import If we are running Subsurface in verbose mode, print the xsltproc command line to test the XSLT manually. Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- file.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/file.c b/file.c index b535029c3..0b893dc3f 100644 --- a/file.c +++ b/file.c @@ -946,6 +946,19 @@ int parse_csv_file(const char *filename, int timef, int depthf, int tempf, int p if (try_to_xslt_open_csv(filename, &mem, csvtemplate)) return -1; + /* + * Lets print command line for manual testing with xsltproc if + * verbosity level is high enough. The printed line needs the + * input file added as last parameter. + */ + + if (verbose >= 2) { + fprintf(stderr, "(echo ''; cat %s;echo '') | xsltproc ", filename); + for (i=0; params[i]; i+=2) + fprintf(stderr, "--stringparam %s %s ", params[i], params[i+1]); + fprintf(stderr, "%s/xslt/csv2xml.xslt -\n", SUBSURFACE_SOURCE); + } + previous = dive_table.nr; ret = parse_xml_buffer(filename, mem.buffer, mem.size, &dive_table, (const char **)params); -- cgit v1.2.3-70-g09d2