diff --git a/src/main.cpp b/src/main.cpp index 754b1cd..565c862 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,7 +15,6 @@ int main() while (!exit) { std::string input; - std::cout << std::unitbuf; std::cout << "$ "; std::getline(std::cin, input); std::optional result; diff --git a/src/shellUtils.cpp b/src/shellUtils.cpp index 2afb507..e9ee394 100644 --- a/src/shellUtils.cpp +++ b/src/shellUtils.cpp @@ -61,22 +61,21 @@ namespace sh void printType(const std::string& input) { - const std::string_view command {input.substr(0, input.find(' '))}; - if (commandMap.contains(command)) + if (commandMap.contains(input)) { - std::cout << command; + std::cout << input; std::cout << " is a shell builtin\n"; return; } if (const auto fullPath {isExec(input)}) { - std::cout << command; + std::cout << input; std::cout << " is " << fullPath.value() << "\n"; return; } - std::cout << command; + std::cout << input; std::cout << ": not found\n"; } }