From 59b6de2550e66716dbad95a1db3325a702132361 Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Thu, 16 Nov 2017 12:29:34 -0500 Subject: [PATCH] Dropping missing(), now implemented correctly --- examples/prefix_command.cpp | 2 +- include/CLI/App.hpp | 63 ++++++++++++++++++++----------------- tests/AppTest.cpp | 2 +- tests/SubcommandTest.cpp | 14 ++++----- 4 files changed, 42 insertions(+), 39 deletions(-) diff --git a/examples/prefix_command.cpp b/examples/prefix_command.cpp index b716c2be..94d9848b 100644 --- a/examples/prefix_command.cpp +++ b/examples/prefix_command.cpp @@ -15,7 +15,7 @@ int main(int argc, char **argv) { } std::vector more_comms = app.remaining(); - + std::cout << "Prefix:"; for(int v : vals) std::cout << v << ":"; diff --git a/include/CLI/App.hpp b/include/CLI/App.hpp index a78d7258..1cce8534 100644 --- a/include/CLI/App.hpp +++ b/include/CLI/App.hpp @@ -584,7 +584,8 @@ class App { App *add_subcommand(std::string name, std::string description = "", bool help = true) { subcommands_.emplace_back(new App(description, help, detail::dummy)); subcommands_.back()->name_ = name; - subcommands_.back()->allow_extras(); + subcommands_.back()->allow_extras_ = allow_extras_; + subcommands_.back()->prefix_command_ = prefix_command_; subcommands_.back()->parent_ = this; subcommands_.back()->ignore_case_ = ignore_case_; subcommands_.back()->fallthrough_ = fallthrough_; @@ -863,23 +864,34 @@ class App { const std::vector