From 0b9305f05c55d73eb08d908f03fdfaaa82ff9abe Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 15 Mar 2022 15:10:12 -0500 Subject: [PATCH] Keep shared_ptr around Signed-off-by: Michael Carroll --- cli/src/cli_TEST.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/src/cli_TEST.cc b/cli/src/cli_TEST.cc index 56055b9..68aa297 100644 --- a/cli/src/cli_TEST.cc +++ b/cli/src/cli_TEST.cc @@ -140,7 +140,8 @@ TEST(cli, help_text) { CLI::App app("Test app"); - addFlags(app); + auto opt = addFlags(app); + app.callback([opt](){}); app.formatter(std::make_shared(&app)); std::cout << app.help(); @@ -151,7 +152,8 @@ TEST(cli, config_text) { CLI::App app("Test app"); - addFlags(app); + auto opt = addFlags(app); + app.callback([opt](){}); std::vector argv = { "--int=50",