Skip to content

Inherit defaults for Options and Apps - #48

Merged
henryiii merged 10 commits into
masterfrom
inherit
Nov 20, 2017
Merged

henryiii merged 10 commits into
masterfrom
inherit

Conversation

@henryiii

@henryiii henryiii commented Nov 20, 2017 •

Copy link
Copy Markdown
Collaborator

This reworks default value inheritance, as outlined in #47 . Key features:

  • "Help" boolean for subcommand and app removed, can be replaced by an empty call to set_help_flag.
  • Subcommand help flag inherited from parent command, make it easier to localize or change
  • Ignore case is no longer mixed between subcommand and options
  • App values that can be inherited: allow_extras, prefix_command, ignore_case, fallthrough, group, and footer (and help flag info)
  • Option value that can be set: group, required, take_last, and ignore_case

To set option defaults:

app.option_defauts()->required();
// All future options will be required

Remaining tasks:

  • Add tests
  • Add README mention/clarification

In the spirit of @lambdafu 's quest to remove localized unchangeable strings, "Hidden" has been replaced by an empty string! check_style.sh is a little more accessible, as well.

@codecov

codecov Bot commented Nov 20, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #48 into master will increase coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #48      +/-   ##
========================================
+ Coverage   99.91%   100%   +0.08%     
========================================
  Files           9      9              
  Lines        1198   1230      +32     
  Branches      246    248       +2     
========================================
+ Hits         1197   1230      +33     
+ Misses          1      0       -1
Impacted Files Coverage Δ
include/CLI/App.hpp 100% <100%> (+0.15%) ⬆️
include/CLI/Option.hpp 100% <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 303f4a5...28a8e30. Read the comment docs.

@henryiii
henryiii merged commit 675e753 into master Nov 20, 2017
@henryiii
henryiii deleted the inherit branch November 20, 2017 23:07
@henryiii henryiii added this to the v1.3 milestone Nov 22, 2017
This was referenced Nov 28, 2017
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.

1 participant