MCPcopy Create free account
hub / github.com/SoarGroup/Soar / DoCommand

Method DoCommand

Core/CLI/src/cli_CommandLineInterface.cpp:143–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143EXPORT bool CommandLineInterface::DoCommand(Connection* pConnection, sml::AgentSML* pAgent, const char* pCommandLine, bool echoResults, bool rawOutput, ElementXML* pResponse)
144{
145 if (!m_pKernelSML)
146 {
147 return false;
148 }
149
150 PushCall(CallData(pAgent, rawOutput));
151
152 // Log input
153 if (m_pLogFile)
154 {
155 if (pAgent)
156 {
157 (*m_pLogFile) << pAgent->GetName() << "> ";
158 }
159 (*m_pLogFile) << pCommandLine << std::endl;
160 }
161
162 SetTrapPrintCallbacks(true);
163
164 m_LastError.clear();
165
166 Source(pCommandLine);
167
168 SetTrapPrintCallbacks(false);
169
170 if (pConnection && pResponse)
171 {
172 GetLastResultSML(pConnection, pResponse, echoResults);
173 }
174
175 PopCall();
176
177 // Always returns true to indicate that we've generated any needed error message already
178 return true;
179}
180
181void CommandLineInterface::PushCall(CallData callData)
182{

Callers 2

HandleDestroyAgentMethod · 0.80
HandleCommandLineMethod · 0.80

Calls 3

CallDataClass · 0.70
GetNameMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected