mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-29 12:13:52 +00:00
Whitespace fixes
This commit is contained in:
parent
c6ddbeb281
commit
aae40fbf0e
@ -1,6 +1,7 @@
|
||||
## Version 1.2 (in progress)
|
||||
|
||||
|
||||
* The name string can now contain spaces around commas [#29](https://github.com/CLIUtils/CLI11/pull/29)
|
||||
* `set_default_str` now only sets string, and `set_default_val` will evaluate the default string given [#26](https://github.com/CLIUtils/CLI11/issues/26)
|
||||
* Required positionals now take priority over subcommands [#23](https://github.com/CLIUtils/CLI11/issues/23)
|
||||
* Extra requirements enforced by Travis
|
||||
|
@ -23,6 +23,13 @@
|
||||
#include "CLI/StringTools.hpp"
|
||||
#include "CLI/TypeTools.hpp"
|
||||
|
||||
#define CLI11_PARSE(app,argc,argv) \
|
||||
try { \
|
||||
(app).parse((argc),(argv)); \
|
||||
} catch(const CLI::ParseError &e) { \
|
||||
return (app).exit(e); \
|
||||
}
|
||||
|
||||
namespace CLI {
|
||||
|
||||
namespace detail {
|
||||
|
@ -260,7 +260,6 @@ TEST_F(TApp, Positionals) {
|
||||
EXPECT_EQ("thing2", posit2);
|
||||
}
|
||||
|
||||
|
||||
TEST_F(TApp, ForcedPositional) {
|
||||
std::vector<std::string> posit;
|
||||
auto one = app.add_flag("--one");
|
||||
|
@ -231,23 +231,20 @@ TEST_F(TApp, CheckNameNoCase) {
|
||||
EXPECT_TRUE(pos2->check_name("pos2"));
|
||||
}
|
||||
|
||||
|
||||
TEST_F(TApp, PreSpaces) {
|
||||
int x;
|
||||
auto myapp = app.add_option(" -a, --long, other", x);
|
||||
|
||||
|
||||
EXPECT_TRUE(myapp->check_lname("long"));
|
||||
EXPECT_TRUE(myapp->check_sname("a"));
|
||||
EXPECT_TRUE(myapp->check_name("other"));
|
||||
|
||||
}
|
||||
|
||||
TEST_F(TApp, AllSpaces) {
|
||||
int x;
|
||||
auto myapp = app.add_option(" -a , --long , other ", x);
|
||||
|
||||
|
||||
EXPECT_TRUE(myapp->check_lname("long"));
|
||||
EXPECT_TRUE(myapp->check_sname("a"));
|
||||
EXPECT_TRUE(myapp->check_name("other"));
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user