mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-02 05:33:53 +00:00
Style updates
This commit is contained in:
parent
6d26440b6e
commit
8cdf1c8651
@ -18,9 +18,7 @@ void setup_subcommand_a( CLI::App& app ) {
|
||||
sub->add_flag("--with-foo", opt->with_foo, "Counter");
|
||||
|
||||
// Set the run function as callback to be called when this subcommand is issued.
|
||||
sub->set_callback([opt]() {
|
||||
run_subcommand_a( *opt );
|
||||
});
|
||||
sub->set_callback([opt]() { run_subcommand_a(*opt); });
|
||||
|
||||
// Note: In C++14, you could make a unique pointer, then pass it into the lambda function via
|
||||
// a move. That's slightly more elegant, but you won't be able to see the runtime difference
|
||||
@ -30,8 +28,7 @@ void setup_subcommand_a( CLI::App& app ) {
|
||||
/// The function that runs our code.
|
||||
/// This could also simply be in the callback lambda itself,
|
||||
/// but having a separate function is cleaner.
|
||||
void run_subcommand_a( SubcommandAOptions const& opt )
|
||||
{
|
||||
void run_subcommand_a(SubcommandAOptions const &opt) {
|
||||
// Do stuff...
|
||||
std::cout << "Working on file: " << opt.file << std::endl;
|
||||
if(opt.with_foo) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user