From 8dfa56709be878d653a56a55bf88833c43f1dd02 Mon Sep 17 00:00:00 2001 From: NaiJi Date: Fri, 18 Dec 2020 23:35:21 +0300 Subject: [PATCH] Fix bug with 3 arguments --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 91bff3e..b64615e 100644 --- a/main.cpp +++ b/main.cpp @@ -56,7 +56,7 @@ static std::tuple parsePath(const std::string &argv) if (dir_image_items.empty()) { - std::cout << "No images found at " << path << "\n --help for more information.\n"; + std::cout << "No images found at " << path << "\n--help for more information.\n"; return {EXIT_FAILURE, {}}; } @@ -117,7 +117,7 @@ static std::tuple parseInput(int argc, char **argv) if (splitting < 1) return error(output::SPLITTING_MSG); - const auto &[ret_code, ret_path] = parsePath(argv[3]); + const auto &[ret_code, ret_path] = parsePath(argc == MAX_ARGC ? argv[3] : DEFAULT_PATH); if (ret_code) return error(output::IMG_FAIL_MSG);