Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Windows style options default on Windows #190

Merged
merged 2 commits into from
Jan 13, 2019

Conversation

henryiii
Copy link
Collaborator

This would add true as the default for Windows style options if building on Windows. Probably will need to make a few tests more specific to help AppVeyor pass.

@phlptp
Copy link
Collaborator

phlptp commented Jan 11, 2019

Change SubCommandDefaults test in CreationTests to

TEST_F(TApp, SubcommandDefaults) {
    // allow_extras, prefix_command, ignore_case, fallthrough, group, min/max subcommand

    // Initial defaults
    EXPECT_FALSE(app.get_allow_extras());
    EXPECT_FALSE(app.get_prefix_command());
    EXPECT_FALSE(app.get_ignore_case());
    EXPECT_FALSE(app.get_ignore_underscore());
#ifdef WIN32
    EXPECT_TRUE(app.get_allow_windows_style_options());
#else
    EXPECT_FALSE(app.get_allow_windows_style_options());
#endif
    EXPECT_FALSE(app.get_fallthrough());
    EXPECT_EQ(app.get_footer(), "");
    EXPECT_EQ(app.get_group(), "Subcommands");
    EXPECT_EQ(app.get_require_subcommand_min(), (size_t)0);
    EXPECT_EQ(app.get_require_subcommand_max(), (size_t)0);

    app.allow_extras();
    app.prefix_command();
    app.ignore_case();
    app.ignore_underscore();
#ifdef WIN32
    app.allow_windows_style_options(false);
#else
    app.allow_windows_style_options();
#endif

    app.fallthrough();
    app.footer("footy");
    app.group("Stuff");
    app.require_subcommand(2, 3);

    auto app2 = app.add_subcommand("app2");

    // Initial defaults
    EXPECT_TRUE(app2->get_allow_extras());
    EXPECT_TRUE(app2->get_prefix_command());
    EXPECT_TRUE(app2->get_ignore_case());
    EXPECT_TRUE(app2->get_ignore_underscore());
#ifdef WIN32
    EXPECT_FALSE(app2->get_allow_windows_style_options());
#else
    EXPECT_TRUE(app2->get_allow_windows_style_options());
#endif
    EXPECT_TRUE(app2->get_fallthrough());
    EXPECT_EQ(app2->get_footer(), "footy");
    EXPECT_EQ(app2->get_group(), "Stuff");
    EXPECT_EQ(app2->get_require_subcommand_min(), (size_t)0);
    EXPECT_EQ(app2->get_require_subcommand_max(), (size_t)3);
}

this passes on my computer in visual studio

@phlptp
Copy link
Collaborator

phlptp commented Jan 11, 2019

I guess it would be _WIN32 to match the App change

@codecov
Copy link

codecov bot commented Jan 12, 2019

Codecov Report

Merging #190 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #190   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines        1889   1889           
=====================================
  Hits         1889   1889
Impacted Files Coverage Δ
include/CLI/App.hpp 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66fedad...20eed02. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jan 12, 2019

Codecov Report

Merging #190 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #190   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines        1889   1889           
=====================================
  Hits         1889   1889
Impacted Files Coverage Δ
include/CLI/App.hpp 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66fedad...20eed02. Read the comment docs.

@henryiii henryiii merged commit 0086ddd into master Jan 13, 2019
@henryiii henryiii deleted the windows_options_default branch January 13, 2019 07:29
@henryiii henryiii added this to the v1.7 milestone Feb 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants