add a command to the history
| 82 | } |
| 83 | /// add a command to the history |
| 84 | void add(const std::string& command) |
| 85 | { |
| 86 | // if current command = last in history -> do not add. Always add if history is empty. |
| 87 | if(!history.empty() && history.front() == command) |
| 88 | return; |
| 89 | history.push_front(command); |
| 90 | if(history.size() > capacity) |
| 91 | history.pop_back(); |
| 92 | } |
| 93 | /// clear the command history |
| 94 | void clear() |
| 95 | { |
nothing calls this directly
no test coverage detected