63 G4cout <<
"aborting Run ...";
68 <<
"Session terminated." <<
G4endl;
73 "KeyboardInterrput with Ctrl-C");
94 UI-> SetSession(
this);
95 UI-> SetCoutDestination(
this);
100 if(aShell)
shell= aShell;
119 UI-> SetSession(NULL);
120 UI-> SetCoutDestination(NULL);
163 if(aCommand.length()<2)
return;
165 G4int returnVal =
UI-> ApplyCommand(aCommand);
167 G4int paramIndex = returnVal % 100;
170 G4int commandStatus = returnVal - paramIndex;
176 switch(commandStatus) {
181 if( aCommand.
index(
"@@") != G4String::npos) {
186 G4cerr <<
"illegal application state -- command refused" <<
G4endl;
198 G4cerr <<
"Parameter is out of candidate list (index " << paramIndex <<
")" <<
G4endl;
202 G4cerr <<
"Parameter is wrong type and/or is not omittable (index " << paramIndex <<
")" <<
G4endl;
206 G4cerr <<
"command refused (" << commandStatus <<
")" <<
G4endl;
217 newCommand=
shell-> GetCommandLineString(msg);
220 if( nC.length() == 0 ) {
221 newCommand= nullString;
223 }
else if( nC(0) ==
'#' ) {
225 newCommand= nullString;
227 }
else if(nC==
"ls" || nC.substr(0,3)==
"ls " ) {
229 newCommand= nullString;
231 }
else if(nC==
"lc" || nC.substr(0,3)==
"lc " ) {
233 newCommand= nullString;
235 }
else if(nC ==
"pwd") {
236 G4cout <<
"Current Command Directory : "
238 newCommand= nullString;
240 }
else if(nC ==
"cwd") {
241 shell-> ShowCurrentDirectory();
242 newCommand= nullString;
244 }
else if(nC ==
"cd" || nC.substr(0,3) ==
"cd ") {
247 newCommand= nullString;
249 }
else if(nC ==
"help" || nC.substr(0,5) ==
"help ") {
251 newCommand= nullString;
253 }
else if(nC(0) ==
'?') {
255 newCommand= nullString;
257 }
else if(nC ==
"hist" || nC ==
"history") {
258 G4int nh=
UI-> GetNumberOfHistory();
259 for (
G4int i=0; i<nh; i++) {
262 newCommand= nullString;
264 }
else if(nC(0) ==
'!') {
268 std::istringstream is(tt);
270 G4int nh=
UI-> GetNumberOfHistory();
272 newCommand=
UI-> GetPreviousCommand(vl);
275 G4cerr <<
"history " << vl <<
" is not found." <<
G4endl;
276 newCommand= nullString;
279 }
else if(nC ==
"exit") {
282 G4cout <<
"Please abort it using \"/run/abort\" command first" <<
G4endl;
283 G4cout <<
" and use \"continue\" command until the application"
288 newCommand= nullString;
291 }
else if( nC ==
"cont" || nC ==
"continue"){
293 newCommand= nullString;
295 }
else if( nC.empty() ){
296 newCommand= nullString;
309 std::cout << coutString << std::flush;
317 std::cerr << cerrString << std::flush;
328 G4cin.ignore(30,
'\n');
339 G4cin.getline(temp, 100);