| 141 | } |
| 142 | |
| 143 | EXPORT 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 | |
| 181 | void CommandLineInterface::PushCall(CallData callData) |
| 182 | { |
no test coverage detected