mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-02 21:53:51 +00:00
Dropping a few lines
This commit is contained in:
parent
d46c2c5727
commit
e8b45de6ec
@ -328,10 +328,7 @@ class App {
|
|||||||
T &variable, ///< The variable to set
|
T &variable, ///< The variable to set
|
||||||
std::string description = "") {
|
std::string description = "") {
|
||||||
|
|
||||||
std::string simple_name = CLI::detail::split(name, ',').at(0);
|
CLI::callback_t fun = [&variable](CLI::results_t res) { return detail::lexical_cast(res[0], variable); };
|
||||||
CLI::callback_t fun = [&variable, simple_name](CLI::results_t res) {
|
|
||||||
return detail::lexical_cast(res[0], variable);
|
|
||||||
};
|
|
||||||
|
|
||||||
Option *opt = add_option(name, fun, description, false);
|
Option *opt = add_option(name, fun, description, false);
|
||||||
opt->set_custom_option(detail::type_name<T>());
|
opt->set_custom_option(detail::type_name<T>());
|
||||||
@ -345,10 +342,7 @@ class App {
|
|||||||
std::string description,
|
std::string description,
|
||||||
bool defaulted) {
|
bool defaulted) {
|
||||||
|
|
||||||
std::string simple_name = CLI::detail::split(name, ',').at(0);
|
CLI::callback_t fun = [&variable](CLI::results_t res) { return detail::lexical_cast(res[0], variable); };
|
||||||
CLI::callback_t fun = [&variable, simple_name](CLI::results_t res) {
|
|
||||||
return detail::lexical_cast(res[0], variable);
|
|
||||||
};
|
|
||||||
|
|
||||||
Option *opt = add_option(name, fun, description, defaulted);
|
Option *opt = add_option(name, fun, description, defaulted);
|
||||||
opt->set_custom_option(detail::type_name<T>());
|
opt->set_custom_option(detail::type_name<T>());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user