Skip to content

Commit 1805ea5

Browse files
committed
Closes #1605
1 parent ab1a78e commit 1805ea5

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/Core/Command/GlobalCommandBuilderFromCommandLine.cc

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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())

src/Core/ConsoleApplication/ConsoleCommands.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ bool InteractiveModeCommandConsole::execute()
189189
if (!PythonInterpreter::Instance().run_string(line))
190190
break;
191191
}
192+
std::cout << std::endl;
192193
LOG_CONSOLE("~~~~~~~");
193194
LOG_CONSOLE("Goodbye!");
194195
LOG_CONSOLE("~~~~~~~");

0 commit comments

Comments
 (0)