810 |
bufferedCommands[socket] += c; // append |
bufferedCommands[socket] += c; // append |
811 |
} |
} |
812 |
} |
} |
813 |
// only if the other side is the LSCP shell application: |
// Only if the other side (client) is the LSCP shell application: |
814 |
// check the current (incomplete) command line for syntax errors, |
// The following block takes care about automatic correction, auto |
815 |
// possible completions and report everything back to the shell |
// completion (and suggestions), LSCP reference documentation, etc. |
816 |
if ((*iter).bShellInteract || (*iter).bShellAutoCorrect) { |
// The "if" statement here is for optimization reasons, so that the |
817 |
String s = lscpParserProcessShellInteraction(bufferedCommands[socket], &(*iter), true); |
// heavy LSCP grammar evaluation algorithm is only executed once for an |
818 |
if (!s.empty() && (*iter).bShellInteract && i == input.size() - 1) |
// entire command line received. |
819 |
AnswerClient(s + "\n"); |
if (i == input.size() - 1) { |
820 |
} |
// check the current (incomplete) command line for syntax errors, |
821 |
// if other side is LSCP shell application, send the relevant LSCP |
// possible completions and report everything back to the shell |
822 |
// documentation section of the current command line (if necessary) |
if ((*iter).bShellInteract || (*iter).bShellAutoCorrect) { |
823 |
if ((*iter).bShellSendLSCPDoc && (*iter).bShellInteract) { |
String s = lscpParserProcessShellInteraction(bufferedCommands[socket], &(*iter), true); |
824 |
String s = generateLSCPDocReply(bufferedCommands[socket], &(*iter)); |
if (!s.empty() && (*iter).bShellInteract && i == input.size() - 1) |
825 |
if (!s.empty()) AnswerClient(s + "\n"); |
AnswerClient(s + "\n"); |
826 |
|
} |
827 |
|
// if other side is LSCP shell application, send the relevant LSCP |
828 |
|
// documentation section of the current command line (if necessary) |
829 |
|
if ((*iter).bShellSendLSCPDoc && (*iter).bShellInteract) { |
830 |
|
String s = generateLSCPDocReply(bufferedCommands[socket], &(*iter)); |
831 |
|
if (!s.empty()) AnswerClient(s + "\n"); |
832 |
|
} |
833 |
} |
} |
834 |
} |
} |
835 |
|
|