From e143f0b9e94c7285887ab98ff03841a6fe4883c0 Mon Sep 17 00:00:00 2001 From: Richard Kimberly Heck Date: Tue, 29 May 2018 15:48:56 -0400 Subject: [PATCH] Remove test for files when using batch mode. As Kornel pointed out, it's possible to give a command sequence, or multiple "-x" arguments, and carry out an operation without actually giving LyX a filename argument. This will lead to cases like: lyx -batch -x buffer-export which don't do anything, but it's not catastrophic. --- src/LyX.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/LyX.cpp b/src/LyX.cpp index 0e1b19faf6..9cdad32598 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -493,12 +493,8 @@ int LyX::init(int & argc, char * argv[]) for (int argi = 1; argi < argc; ++argi) pimpl_->files_to_load_.push_back(os::utf8_argv(argi)); - if (!use_gui && pimpl_->files_to_load_.empty()) { - lyxerr << to_utf8(_("Missing filename for this operation.")) << endl; - return EXIT_FAILURE; - } - - if (first_start) { + // doesn't make sense to load the splash file in batch mode + if (use_gui && first_start) { pimpl_->files_to_load_.push_back( i18nLibFileSearch("examples", "splash.lyx").absFileName()); } -- 2.39.2