Skip to content

Adding simple flag callback - #33

Merged
henryiii merged 5 commits into
masterfrom
flagcb
Sep 11, 2017
Merged

henryiii merged 5 commits into
masterfrom
flagcb

Conversation

@henryiii

@henryiii henryiii commented Sep 10, 2017 •

Copy link
Copy Markdown
Collaborator

This should fix #32 in a general way, I think.

.add_flag_functional("--name", [](size_t count){...});

C++14 shortcut:

.add_flag("--name", [](size_t count){...});

This can't be added to C++11 since the compiler can't tell the difference between std::string and std::function<void(size_t)> for a const char * argument until C++14 (or C++11 mode on a C++14 compiler, since this was back-fixed as a bug, but that's too specific to provide #if's for).

@henryiii henryiii changed the title Addind simple flag callback Adding simple flag callback Sep 10, 2017
@codecov

codecov Bot commented Sep 11, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #33 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #33   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           9      9           
  Lines        1121   1141   +20     
  Branches      231    233    +2     
=====================================
+ Hits         1121   1141   +20
Impacted Files Coverage Δ
include/CLI/Timer.hpp 100% <ø> (ø) ⬆️
include/CLI/App.hpp 100% <100%> (ø) ⬆️
include/CLI/Validators.hpp 100% <0%> (ø) ⬆️

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 adbd2aa...636795d. Read the comment docs.

@infinity0n3

Copy link
Copy Markdown

I can confirm that it works now. Would have been nicer to have the add_flag syntax but I have to use c++11.
Good thing is that it's a one liner now.

Thank you!

@henryiii
henryiii merged commit 37667f5 into master Sep 11, 2017
@henryiii
henryiii deleted the flagcb branch September 11, 2017 15:45
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.

Version flag/option

2 participants