]> git.lyx.org Git - lyx.git/commitdiff
The --batch patch.
authorRichard Heck <rgheck@comcast.net>
Mon, 6 Apr 2009 12:13:33 +0000 (12:13 +0000)
committerRichard Heck <rgheck@comcast.net>
Mon, 6 Apr 2009 12:13:33 +0000 (12:13 +0000)
Introduces a "--batch" command line flag, so you can do this:
lyx --batch -x "buffer-print printer default dvips" myfile.lyx
The "--batch" flag basically means: no gui.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29126 a592a061-630c-0410-9148-cb99ea01b6c8

RELEASE-NOTES
src/LyX.cpp

index 0d581c47663f6eba1504d8a08f39c8ea7fd1989c..6a7f087e5efe71250b695518ddceca10b8c5edf3 100644 (file)
@@ -8,6 +8,15 @@ been applied because of incomplete testing.
 Interface changes
 -----------------
 
+There have been some changes to the LyX command line. There is a new option 
+"--batch" that causes LyX to run the given commands without opening a GUI 
+window. Thus, something like:
+    lyx --batch -x "buffer-print printer default dvips" myfile.lyx
+will cause LyX to print myfile.lyx to the default printer, using dvips and 
+the default print settings (which, of course, have to have been configured 
+already). At present, not many commands can be used this way, but there will
+be more eventually.
+
 The following variables are obsoleted in 2.0
 
 - \plaintext_roff_command (was not used anymore)
index ebfedd1b81b92ed2b7236412275c79c0b30ad92c..3445dfdc3721494a0f7cdf7dcf3179d5182682ac 100644 (file)
@@ -985,6 +985,7 @@ int parse_help(string const &, string const &, string &)
                  "\t-i [--import] fmt file.xxx\n"
                  "                  where fmt is the import format of choice\n"
                  "                  and file.xxx is the file to be imported.\n"
+                 "\t--batch         execute commands and exit\n"
                  "\t-version        summarize version and build info\n"
                               "Check the LyX man page for more details.")) << endl;
        exit(0);
@@ -1079,6 +1080,13 @@ int parse_geometry(string const & arg1, string const &, string &)
 }
 
 
+int parse_batch(string const &, string const &, string &) 
+{
+       use_gui = false;
+       return 0;
+}
+
+
 } // namespace anon
 
 
@@ -1100,6 +1108,7 @@ void LyX::easyParse(int & argc, char * argv[])
        cmdmap["-i"] = parse_import;
        cmdmap["--import"] = parse_import;
        cmdmap["-geometry"] = parse_geometry;
+       cmdmap["--batch"] = parse_batch;
 
        for (int i = 1; i < argc; ++i) {
                map<string, cmd_helper>::const_iterator it