mirror of
https://github.com/fmang/opustags.git
synced 2024-11-13 00:42:46 +01:00
Options: require output path to be non empty
This commit is contained in:
parent
f726eaeb91
commit
b5d2e03a7b
@ -56,6 +56,8 @@ Options opustags::parse_args(const int argc, char **argv)
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
if (arg.empty())
|
||||
throw ArgumentError("Output path cannot be empty");
|
||||
options.path_out = arg;
|
||||
break;
|
||||
|
||||
|
@ -92,6 +92,8 @@ TEST_CASE("option parsing", "[options]")
|
||||
SECTION("--output") {
|
||||
REQUIRE(retrieve_options({"--output", "ABC"}).path_out == "ABC");
|
||||
REQUIRE(retrieve_options({"-o", "ABC"}).path_out == "ABC");
|
||||
REQUIRE_THROWS(retrieve_options({"--output", ""}));
|
||||
REQUIRE_THROWS(retrieve_options({"-o", ""}));
|
||||
}
|
||||
|
||||
SECTION("--delete-all") {
|
||||
|
Loading…
Reference in New Issue
Block a user