@@ -75,13 +75,18 @@ using namespace SCIRun::Core::Algorithms;
7575
7676 if (!params->disableGui ())
7777 q->enqueue (cmdFactory_->create (GlobalCommands::ShowMainWindow));
78- else
79- std::cout << " HEADLESS MODE" << std::endl; // / @todo obviously
8078
8179 if (params->dataDirectory ())
8280 q->enqueue (cmdFactory_->create (GlobalCommands::SetupDataDirectory));
8381
84- if (!params->inputFiles ().empty () || params->loadMostRecentFile ())
82+ if (params->pythonScriptFile ())
83+ {
84+ if (params->executeNetworkAndQuit ())
85+ q->enqueue (cmdFactory_->create (GlobalCommands::SetupQuitAfterExecute));
86+ q->enqueue (cmdFactory_->create (GlobalCommands::RunPythonScript));
87+ std::cout << " Please note all args after script file name will be passed to python and not SCIRun!" << std::endl;
88+ }
89+ else if (!params->inputFiles ().empty () || params->loadMostRecentFile ())
8590 {
8691 const int last = 1 ;
8792 // TODO: support multiple files loaded--need to be able to execute and wait for each before loading next. See #825
@@ -104,11 +109,10 @@ using namespace SCIRun::Core::Algorithms;
104109 }
105110 }
106111 }
107- else if (params->pythonScriptFile ())
112+ else if (params->disableGui () && !params-> interactiveMode ())
108113 {
109- if (params->executeNetworkAndQuit ())
110- q->enqueue (cmdFactory_->create (GlobalCommands::SetupQuitAfterExecute));
111- q->enqueue (cmdFactory_->create (GlobalCommands::RunPythonScript));
114+ std::cout << " No input files: run with GUI or in interactive mode (-i)" << std::endl;
115+ q->enqueue (cmdFactory_->create (GlobalCommands::QuitCommand));
112116 }
113117
114118 if (params->interactiveMode ())
0 commit comments