timabell / sqlHawk

Database management / migration tooling. Java / JDBC based.
http://timabell.github.com/sqlHawk/
GNU General Public License v3.0
8 stars 4 forks source link

html - graphviz path escaping is borked #72

Open timabell opened 12 years ago

timabell commented 12 years ago

worked in 0.7.3, broken in 0.7.4

java -jar "C:\Program Files\SqlHawk\sqlhawk.jar"                         --database-input -t mssql05-jtds -h localhost --sso -d Dev
 -s dbo      --driver-path "C:\Program Files\jtds-1.2.5\jtds-1.2.5.jar"         --html-output --xml-output --target-path schema-doc_localhost_ShellDocumentGeneratorDev             --graphviz-path "C:\
Program Files (x86)\Graphviz\"
sqlHawk release-0.7.4 2012-06-15 01:40:18 +0100
More information at http://timabell.github.com/sqlHawk/
License: GPLv3.

00:28:02.631 INFO:    SchemaMapper.getConnection - Connected to Microsoft SQL Server - 10.50.1600
00:28:02.641 INFO:    SchemaMapper.readDb - Gathering schema details...
00:28:03.165 INFO:    HtmlWriter.writeHtml - Gathered schema details
00:28:03.165 INFO:    HtmlWriter.writeHtml - Writing/graphing summary...
00:28:03.179 WARNING: Dot.<init> - Failed to query Graphviz version information  with: C:\Program Files (x86)\Graphviz"\bin\dot -V
  java.io.IOException: Cannot run program "C:\Program Files (x86)\Graphviz"\bin\dot": CreateProcess error=5, Access is denied
00:28:03.238 WARNING: HtmlDiagramFormatter.getDot - Failed to run dot.
   Download dot version 2.2.1 or versions greater than 2.4
   from www.graphviz.org and make sure that dot is either in your path
   or point to where you installed Graphviz with the --graphviz-path option.
   Generated pages will not contain a diagramtic view of table relationships.
00:28:03.358 INFO:    HtmlWriter.writeHtml - Completed summary
00:28:03.360 INFO:    HtmlWriter.writeHtml - Writing/diagramming details...
00:28:04.019 INFO:    SchemaMapper.RunMapping - Done.
timabell commented 7 years ago

it's pulling the trailing quote into the parsed string

timabell commented 7 years ago

oh jeez, it's the last backslash, it's causing the quote to be escaped. argh.

http://www.martiansoftware.com/jsap/doc/javadoc/com/martiansoftware/jsap/CommandLineTokenizer.html - jsap escaping

timabell commented 7 years ago

I think the proper fix to this is to switch to a less buggy & antiquated arg parser. Need to look into options: http://jewelcli.lexicalscope.com/related.html

As a workaround double up the last slash on the path to escape it and stop it escaping the closing quote.

--graphviz-path "C:\Program Files (x86)\Graphviz\\"
timabell commented 7 years ago

maybe use this fork https://github.com/BladeRunnerJS/jsap or maybe do a fresh clone & fix it myself... my fork with cvs history ready for patching https://github.com/timabell/jsap