1 /* 2 Copyright 2019-2022 René Ferdinand Rivera Morell 3 Distributed under the Boost Software License, Version 1.0. 4 (See accompanying file LICENSE.txt or copy at 5 http://www.boost.org/LICENSE_1_0.txt) 6 */ 7 8 #include <lyra/lyra.hpp> 9 #include "mini_test.hpp" 10 main()11int 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 } 39