| 9 | #include "mini_test.hpp" |
| 10 | |
| 11 | int main() |
| 12 | { |
| 13 | using namespace lyra; |
| 14 | bfg::mini_test::scope test; |
| 15 | |
| 16 | { |
| 17 | bool a = false, b = false, c = false; |
| 18 | auto cli = opt( a )["-a"] | opt( b )["-b"] | opt( c )["-c"]; |
| 19 | auto result = cli.parse({ "TestApp", "-a", "-b", "-c" }); |
| 20 | test |
| 21 | (REQUIRE(result)) |
| 22 | (REQUIRE(a)) |
| 23 | (REQUIRE(b)) |
| 24 | (REQUIRE(c)); |
| 25 | } |
| 26 | { |
| 27 | bool a = false, b = false, c = false; |
| 28 | auto cli = opt( a )["-a"] | opt( b )["-b"] | opt( c )["-c"]; |
| 29 | auto result = cli.parse({ "TestApp", "-abc" }); |
| 30 | test |
| 31 | (REQUIRE(result)) |
| 32 | (REQUIRE(a)) |
| 33 | (REQUIRE(b)) |
| 34 | (REQUIRE(c)); |
| 35 | } |
| 36 | |
| 37 | return test; |
| 38 | } |