Added 'no wait' option (-w) for command line (Windows only), Issue 2314
This commit is contained in:
@@ -159,6 +159,15 @@ int main(int argc, char **argv)
|
||||
bool stderrRedirectedtoFile = (GetFileType(GetStdHandle(STD_ERROR_HANDLE)) == 0x0001);
|
||||
// no console, if stdout and stderr both are redirected to file
|
||||
if( !(stdoutRedirectedtoFile && stderrRedirectedtoFile)) {
|
||||
// check if parameter -w was passed.
|
||||
// We have to do that in this step, because it controls whether to open a console to show the output of following steps
|
||||
bool Console = true;
|
||||
for(int i=1;i<argc;i++)
|
||||
if(!strcmp(argv[i],"-w")) {
|
||||
Console = false;
|
||||
break;
|
||||
}
|
||||
if(Console) {
|
||||
AllocConsole();
|
||||
AttachConsole( GetCurrentProcessId() ) ;
|
||||
// Don't allow CTRL-C in console to terminate RT
|
||||
@@ -185,11 +194,12 @@ int main(int argc, char **argv)
|
||||
|
||||
consoleOpened = true;
|
||||
|
||||
// printing RT's version in all case, particularly useful for the 'verbose' mode, but also for the batch processing
|
||||
// printing RT's version in every case, particularly useful for the 'verbose' mode, but also for the batch processing
|
||||
std::cout << "RawTherapee, version " << VERSION << std::endl;
|
||||
std::cout << "WARNING: closing this window will close RawTherapee!" << std::endl << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ret = processLineParams( argc, argv);
|
||||
if( ret <= 0 ) {
|
||||
@@ -424,6 +434,10 @@ int processLineParams( int argc, char **argv )
|
||||
}
|
||||
}
|
||||
break;
|
||||
#ifdef WIN32
|
||||
case 'w': // This case is handled outside this function
|
||||
break;
|
||||
#endif
|
||||
case 'h':
|
||||
case '?':
|
||||
default:
|
||||
@@ -433,6 +447,9 @@ int processLineParams( int argc, char **argv )
|
||||
std::cout << " " << Glib::path_get_basename(argv[0]) << " [<selected dir>] Start File Browser inside directory." << std::endl;
|
||||
std::cout << " " << Glib::path_get_basename(argv[0]) << " <file> Start Image Editor with file." << std::endl;
|
||||
std::cout << " " << Glib::path_get_basename(argv[0]) << " -c <dir>|<files> Convert files in batch with default parameters." << std::endl << std::endl;
|
||||
#ifdef WIN32
|
||||
std::cout << " -w Do not open the Windows console" << std::endl;
|
||||
#endif
|
||||
std::cout << "Other options used with -c (-c must be the last option):" << std::endl;
|
||||
std::cout << Glib::path_get_basename(argv[0]) << " [-o <output>|-O <output>] [-s|-S] [-p <files>] [-d] [-j[1-100]|-t|-t1|-n] -Y -c <input>" << std::endl;
|
||||
std::cout << " -o <file>|<dir> Select output file or directory." << std::endl;
|
||||
|
Reference in New Issue
Block a user