| 1099 | } |
| 1100 | |
| 1101 | void CliImpl::process_commands(std::istream* input_stream) |
| 1102 | { |
| 1103 | try { |
| 1104 | FC_ASSERT(input_stream != nullptr); |
| 1105 | _input_stream = input_stream; |
| 1106 | //force flushing to console and log file whenever input is read |
| 1107 | _input_stream->tie(_out); |
| 1108 | string line = get_line(get_prompt()); |
| 1109 | while (_input_stream->good() && !_quit) |
| 1110 | { |
| 1111 | |
| 1112 | if (!execute_command_line(line)) |
| 1113 | break; |
| 1114 | if (!_quit) |
| 1115 | line = get_line(get_prompt()); |
| 1116 | } // while cin.good |
| 1117 | wlog("process commands exiting"); |
| 1118 | } FC_CAPTURE_AND_RETHROW() |
| 1119 | } |
| 1120 | |
| 1121 | } // end namespace detail |
| 1122 | |
| 1123 | Cli::Cli(thinkyoung::client::Client* client, std::istream* command_script, std::ostream* output_stream) |
| 1124 | :my(new detail::CliImpl(client, command_script, output_stream)) |
no test coverage detected