Fix bug with 3 arguments

This commit is contained in:
NaiJi ✨ 2020-12-18 23:35:21 +03:00
parent f3be53050e
commit 8dfa56709b
1 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ static std::tuple<int, std::string> parsePath(const std::string &argv)
if (dir_image_items.empty()) 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, {}}; return {EXIT_FAILURE, {}};
} }
@ -117,7 +117,7 @@ static std::tuple<int, int, std::string> parseInput(int argc, char **argv)
if (splitting < 1) if (splitting < 1)
return error(output::SPLITTING_MSG); 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) if (ret_code)
return error(output::IMG_FAIL_MSG); return error(output::IMG_FAIL_MSG);