documents passed as arguments and then exit. If the lyxpipe is not set up or
is not working, a new instance is created and execution continues normally.
.TP
+\fB \-v [\-\-verbose]\fP
+print on terminal all spawned external commands.
+.TP
.BI \-batch
causes LyX to run the given commands without opening a GUI window.
Thus, something like:
bool use_gui = true;
+// Report on the terminal about spawned commands. The default is false
+// and can be changed with the option -v (--verbose).
+
+bool verbose = false;
+
+
// We default to open documents in an already running instance, provided that
// the lyxpipe has been setup. This can be overridden either on the command
// line or through preference settings.
"\t-r [--remote]\n"
" open documents in an already running instance\n"
" (a working lyxpipe is needed)\n"
+ "\t-v [--verbose]\n"
+ " report on terminal about spawned commands.\n"
"\t-batch execute commands without launching GUI and exit.\n"
"\t-version summarize version and build info\n"
"Check the LyX man page for more details.")) << endl;
}
+int parse_verbose(string const &, string const &, string &)
+{
+ verbose = true;
+ return 0;
+}
+
+
int parse_force(string const & arg, string const &, string &)
{
if (arg == "all") {
cmdmap["--no-remote"] = parse_noremote;
cmdmap["-r"] = parse_remote;
cmdmap["--remote"] = parse_remote;
+ cmdmap["-v"] = parse_verbose;
+ cmdmap["--verbose"] = parse_verbose;
for (int i = 1; i < argc; ++i) {
map<string, cmd_helper>::const_iterator it
void GuiProgressView::appendLyXErrText(QString const & text)
{
+ // Skip verbose messages meant for the terminal
+ if (text.startsWith("\nRunning:"))
+ return;
+
widget_->outTE->moveCursor(QTextCursor::End);
widget_->outTE->insertPlainText(text);
widget_->outTE->ensureCursorVisible();
#include "support/os.h"
#include "support/ProgressInterface.h"
+#include "LyX.h"
#include "LyXRC.h"
#include <cstdlib>
bool process_events)
{
string const what_ss = commandPrep(what);
- LYXERR(Debug::INFO,"Running: " << what_ss);
+ if (verbose)
+ lyxerr << "\nRunning: " << what_ss << endl;
+ else
+ LYXERR(Debug::INFO,"Running: " << what_ss);
string infile;
string outfile;
#include <config.h>
+#include "LyX.h"
#include "LyXRC.h"
#include "support/filetools.h"
// pstream (process stream), with the
// variants ipstream, opstream
+ if (verbose)
+ lyxerr << "\nRunning: " << cmd << endl;
+ else
+ LYXERR(Debug::INFO,"Running: " << cmd);
+
#if defined (_WIN32)
STARTUPINFO startup;
PROCESS_INFORMATION process;