On 09/09/2011 9:51 PM, Julien Rioux wrote:
On 09/09/2011 8:57 PM, Tommaso Cucinotta wrote:
I also checked the front-end part by Guenter, and I have to say we had
that potential issue
that

lyx -o path -e latex

would work, but

lyx -e latex -o path

This is a better syntax, isn't it? It's still possible. When you call
parse_export it sets a flag instead of doing the export right away and
when all arguments have been looped through you check that flag, and
call do_export.


I now understand why you don't want to touch the parser too much. However we can easily allow both
lyx -e pdf in.lyx
lyx -e pdf out.pdf in.lyx

See attached.

I think this fits well with the syntax for import
lyx -i latex in.tex
and with your code for buffer-export LFUN.

--
Julien
Index: ../src/LyX.cpp
===================================================================
--- ../src/LyX.cpp	(revision 39645)
+++ ../src/LyX.cpp	(working copy)
@@ -1123,7 +1123,7 @@
 }
 
 
-int parse_export(string const & type, string const &, string & batch)
+int parse_export(string const & type, string const & filename, string & batch)
 {
 	if (type.empty()) {
 		lyxerr << to_utf8(_("Missing file type [eg latex, ps...] after "
@@ -1132,6 +1132,10 @@
 	}
 	batch = "buffer-export " + type;
 	use_gui = false;
+	if (!filename.empty()) {
+		batch += " " + filename;
+		return 2;
+	}
 	return 1;
 }
 

Reply via email to