-
Notifications
You must be signed in to change notification settings - Fork 353
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
Silent subcommands #529
Silent subcommands #529
Conversation
97e3f26
to
b49a575
Compare
Codecov Report
@@ Coverage Diff @@
## master #529 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 12 12
Lines 3766 3772 +6
=========================================
+ Hits 3766 3772 +6
Continue to review full report at Codecov.
|
b49a575
to
f246a17
Compare
|
||
/// indicator that the subcommand is silent and won't show up in subcommands list | ||
/// This is potentially useful as a modifier subcommand | ||
bool silent_{false}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be moved up to be with the other 8-bit members; if bools are placed together the compiler is more likely to pack them into 8 bits each, rather than adding alignment spacing. Technically, we probably should try to order the struct members large to small, but optimizing this is not really that important - it's just nice to do it right when we add something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to put it into a gap in alignment, I rearranged a bit
include/CLI/App.hpp
Outdated
void _parse_config(const std::vector<ConfigItem> &args) { | ||
for(const ConfigItem &item : args) { | ||
void _parse_config(std::vector<ConfigItem> &args) { | ||
for(ConfigItem item : args) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recommended by clang-tidy or some other static analysis tools I ran
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to change it back, it might have been a merge conflict or something
fe7dfdd
to
a43597b
Compare
… in the subcommands list if used. Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
a43597b
to
3c0f6fc
Compare
I think this is ready now @henryiii |
add a silent option to subcommands to prevent the use from showing up in the subcommands list if used.
This is in response to Issue #522.
Adds an ability to silence subcommands and prevent them from showing up in the used subcommands list.
This allows things like