[Teton] Add a command to print the working directory.
This commit is contained in:
parent
faa54bc3dc
commit
57947fb5dd
|
@ -14,7 +14,13 @@ void Terminal::HandleCharacter(char c) {
|
|||
}
|
||||
|
||||
void Terminal::ExecuteCommand(const glcr::String& command) {
|
||||
console_.WriteString("Executing: ");
|
||||
console_.WriteString(command);
|
||||
console_.WriteString("\n>");
|
||||
if (command == "cwd") {
|
||||
console_.WriteString(cwd_);
|
||||
console_.WriteChar('\n');
|
||||
} else {
|
||||
console_.WriteString("Unknown command: ");
|
||||
console_.WriteString(command);
|
||||
console_.WriteChar('\n');
|
||||
}
|
||||
console_.WriteChar('>');
|
||||
}
|
||||
|
|
|
@ -14,4 +14,6 @@ class Terminal : public mmth::KeyboardListenerBase {
|
|||
private:
|
||||
Console& console_;
|
||||
glcr::VariableStringBuilder current_command_;
|
||||
|
||||
glcr::String cwd_ = "/";
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue