Compare commits
No commits in common. "26ab661dbfa59b55a220dc748bd3bf65c34d6ccd" and "ea8598068d7189f9f3fd505da612b00616be8eee" have entirely different histories.
26ab661dbf
...
ea8598068d
|
@ -25,22 +25,10 @@ void Terminal::ExecuteCommand(const glcr::String& command) {
|
||||||
}
|
}
|
||||||
glcr::StringView cmd = tokens[0];
|
glcr::StringView cmd = tokens[0];
|
||||||
if (cmd == "help") {
|
if (cmd == "help") {
|
||||||
console_.WriteString("Available Commands: pwd cd ls\n");
|
console_.WriteString("Available Commands: cwd\n");
|
||||||
} else if (cmd == "pwd") {
|
} else if (cmd == "cwd") {
|
||||||
console_.WriteString(cwd_);
|
console_.WriteString(cwd_);
|
||||||
console_.WriteChar('\n');
|
console_.WriteChar('\n');
|
||||||
} else if (cmd == "cd") {
|
|
||||||
if (tokens.size() != 2) {
|
|
||||||
console_.WriteString("Provide an absolute path.\n>");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
auto files_or = mmth::ListDirectory(tokens[1]);
|
|
||||||
if (files_or.ok()) {
|
|
||||||
cwd_ = tokens[1];
|
|
||||||
} else {
|
|
||||||
console_.WriteString(glcr::StrFormat("Error: {}\n", files_or.error()));
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (cmd == "ls") {
|
} else if (cmd == "ls") {
|
||||||
glcr::StringView directory;
|
glcr::StringView directory;
|
||||||
if (tokens.size() > 1) {
|
if (tokens.size() > 1) {
|
||||||
|
|
Loading…
Reference in New Issue