1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-29 20:23:55 +00:00

Whitespace fixes

This commit is contained in:
Henry Fredrick Schreiner 2017-09-05 23:06:10 -04:00 committed by Henry Schreiner
parent c6ddbeb281
commit aae40fbf0e
4 changed files with 10 additions and 6 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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");

View File

@ -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"));
}