diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2015-07-27 16:13:31 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-27 06:35:00 -0700 |
commit | 9898e02ae6a6141432cc69b489cec62a6861acab (patch) | |
tree | d395329a278deaa64e68e1dbcb9843935873c838 /file.c | |
parent | 6953824bd639fd8bcf63b1c053c6560370460f48 (diff) | |
download | subsurface-9898e02ae6a6141432cc69b489cec62a6861acab.tar.gz |
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 <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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 '<csv>'; cat %s;echo '</csv>') | 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); |