| 910 | } |
| 911 | |
| 912 | inline void CliSession::Feed(const std::string& cmd) |
| 913 | { |
| 914 | std::vector<std::string> strs; |
| 915 | detail::split(strs, cmd); |
| 916 | if (strs.empty()) return; // just hit enter |
| 917 | |
| 918 | history.NewCommand(cmd); // add anyway to history |
| 919 | |
| 920 | try |
| 921 | { |
| 922 | // global cmds check |
| 923 | bool found = globalScopeMenu->ScanCmds(strs, *this); |
| 924 | |
| 925 | // root menu recursive cmds check |
| 926 | if (!found) found = current->ScanCmds(strs, *this); |
| 927 | |
| 928 | if (!found) // wrong command handler if not found |
| 929 | cli.WrongCommandHandler(out, cmd); |
| 930 | } |
| 931 | catch(const std::exception& e) |
| 932 | { |
| 933 | cli.StdExceptionHandler(out, cmd, e); |
| 934 | } |
| 935 | catch(...) |
| 936 | { |
| 937 | out << "Cli. Unknown exception caught handling command line \"" |
| 938 | << cmd |
| 939 | << "\"\n"; |
| 940 | } |
| 941 | } |
| 942 | |
| 943 | inline void CliSession::Prompt() |
| 944 | { |
nothing calls this directly
no test coverage detected