From ea552af646e6bda09e88adf9792f0237f3c3197d Mon Sep 17 00:00:00 2001 From: Joseph Aquino Date: Thu, 25 Dec 2025 19:32:34 -0500 Subject: [PATCH] fix print type --- src/main.cpp | 1 - src/shellUtils.cpp | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) 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"; } }