From 6ee65ae6f23b76b6b1ca2b3ab808705a7cc2ea84 Mon Sep 17 00:00:00 2001 From: Leonetienne Date: Wed, 9 Feb 2022 03:51:05 +0100 Subject: Nyow suwppoting cmd ags --- main.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 96e358a..feb4663 100644 --- a/main.cpp +++ b/main.cpp @@ -264,11 +264,23 @@ std::string MakeUwu(std::string boringString) { return boringString; } -int main() { +int main(int argc, char** argv) { - std::string buf; - while (std::getline(std::cin, buf)) - std::cout << MakeUwu(buf) << std::endl; + // We have arguments. Uwwuifie these instead + if (argc > 1) + { + for (std::size_t i = 1; i < argc; i++) + std::cout << MakeUwu(argv[i]) + " "; + + std::cout << std::endl; + } + // Else, be prepared to get __piped__ + else + { + std::string buf; + while (std::getline(std::cin, buf)) + std::cout << MakeUwu(buf) << std::endl; + } return 0; } -- cgit v1.2.3