Re: Asciidoctor-java-integration Main class
Posted by asotobu on
URL: https://discuss.asciidoctor.org/Asciidoctor-java-integration-Main-class-tp266p268.html
Thanks, yes I must create MANIFEST with correct data, and a script file (sh and bat) so you don't have to use the large form java -jar <class> <options> but this will be for next version. The main reason why I couldn't release this feature as complete solution with this version is that I have a problem with jcommander. If you want to read AsciiDoc from standard input (by using - as input), jcommander thinks that you have missed a parameter and throws an exception. So for example:
java -cp jruby-complete-1.7.4.jar:jcommander-1.30.jar:asciidoctor-java-integration-0.1.3.jar org.asciidoctor.cli.AsciidoctorInvoker -
which should let users to write into console in AsciiDoc format, does not work because of a parse exception. Maybe we could change this character in Java part, but sincerely I would prefer not to do it. Also with Jason we wrote a tweet to Cédric but no response yet. The other alternative is to preparse command arguments, but then the code it is a bit clunky because all parameters are parsed with jcommander except the last one.
Well at least we have a way to continue so next version will contain a zip file with required files to be executed from command line.
Alex.