101 newCommand =
shell_-> GetCommandLineString(msg);
104 if( nC.length() == 0 ) {
105 newCommand = nullString;
107 }
else if( nC[0] ==
'#' ) {
108 G4cout << nC << G4endl;
109 newCommand = nullString;
111 }
else if( nC ==
"ls" || nC.substr(0,3) ==
"ls " ) {
113 newCommand = nullString;
115 }
else if( nC ==
"lc" || nC.substr(0,3) ==
"lc " ) {
116 shell_-> ListCommand(nC.erase(0,2));
117 newCommand = nullString;
119 }
else if( nC ==
"pwd" ) {
120 G4cout <<
"Current Command Directory : "
121 << GetCurrentWorkingDirectory() << G4endl;
122 newCommand = nullString;
124 }
else if( nC ==
"cwd" ) {
125 shell_-> ShowCurrentDirectory();
126 newCommand = nullString;
128 }
else if(nC ==
"cd" || nC.substr(0,3) ==
"cd " ) {
129 ChangeDirectoryCommand(nC);
130 shell_-> SetCurrentDirectory(GetCurrentWorkingDirectory());
131 newCommand = nullString;
133 }
else if( nC ==
"help" || nC.substr(0,5) ==
"help " ) {
135 newCommand = nullString;
137 }
else if( nC[0] ==
'?' ) {
139 newCommand = nullString;
141 }
else if( nC ==
"hist" || nC ==
"history" ) {
142 G4int nh= ::UI-> GetNumberOfHistory();
143 for( G4int i = 0; i<nh; i++ ) {
144 G4cout << i <<
": " << ::UI-> GetPreviousCommand(i) << G4endl;
146 newCommand = nullString;
148 }
else if( nC[0] ==
'!' ) {
149 G4String ss = nC.substr(1, nC.length()-1);
152 std::istringstream is(tt);
154 G4int nh = ::UI-> GetNumberOfHistory();
155 if( vl>=0 && vl<nh ) {
156 newCommand = ::UI-> GetPreviousCommand(vl);
157 G4cout << newCommand << G4endl;
159 G4cerr <<
"history " << vl <<
" is not found." << G4endl;
160 newCommand = nullString;
163 }
else if( nC.empty() ) {
164 newCommand = nullString;
166 }
else if( nC ==
"exit" ) {
174 return ModifyToFullPathCommand(newCommand);