@@ -43,12 +43,12 @@ namespace CLI {
4343namespace detail {
4444enum class Classifier { NONE, POSITIONAL_MARK, SHORT, LONG, WINDOWS, SUBCOMMAND, SUBCOMMAND_TERMINATOR };
4545struct AppFriend ;
46- } // namespace detail
46+ } // namespace detail
4747
4848namespace FailureMessage {
4949std::string simple (const App *app, const Error &e);
5050std::string help (const App *app, const Error &e);
51- } // namespace FailureMessage
51+ } // namespace FailureMessage
5252
5353// / enumeration of modes of how to deal with extras in config files
5454
@@ -464,7 +464,7 @@ class App {
464464 auto *p = (parent_ != nullptr ) ? _get_fallthrough_parent () : this ;
465465 auto &match = _compare_subcommand_names (*this , *p);
466466 if (!match.empty ()) {
467- ignore_case_ = false ; // we are throwing so need to be exception invariant
467+ ignore_case_ = false ; // we are throwing so need to be exception invariant
468468 throw OptionAlreadyAdded (" ignore case would cause subcommand name conflicts: " + match);
469469 }
470470 }
@@ -586,19 +586,19 @@ class App {
586586 }
587587 }
588588 // this line should not be reached the above loop should trigger the throw
589- throw (OptionAlreadyAdded (" added option matched existing option name" )); // LCOV_EXCL_LINE
589+ throw (OptionAlreadyAdded (" added option matched existing option name" )); // LCOV_EXCL_LINE
590590 }
591591
592592 // / Add option for assigning to a variable
593593 template <typename AssignTo,
594594 typename ConvertTo = AssignTo,
595595 enable_if_t <!std::is_const<ConvertTo>::value, detail::enabler> = detail::dummy>
596596 Option *add_option (std::string option_name,
597- AssignTo &variable, // /< The variable to set
597+ AssignTo &variable, // /< The variable to set
598598 std::string option_description = " " ,
599599 bool defaulted = false ) {
600600
601- auto fun = [&variable](const CLI::results_t &res) { // comment for spacing
601+ auto fun = [&variable](const CLI::results_t &res) { // comment for spacing
602602 return detail::lexical_conversion<AssignTo, ConvertTo>(res, variable);
603603 };
604604
@@ -619,7 +619,7 @@ class App {
619619 // / Add option for a callback of a specific type
620620 template <typename T>
621621 Option *add_option_function (std::string option_name,
622- const std::function<void (const T &)> &func, // /< the callback to execute
622+ const std::function<void (const T &)> &func, // /< the callback to execute
623623 std::string option_description = "") {
624624
625625 auto fun = [func](const CLI::results_t &res) {
@@ -731,7 +731,7 @@ class App {
731731 template <typename T,
732732 enable_if_t <std::is_integral<T>::value && !is_bool<T>::value, detail::enabler> = detail::dummy>
733733 Option *add_flag (std::string flag_name,
734- T &flag_count, // /< A variable holding the count
734+ T &flag_count, // /< A variable holding the count
735735 std::string flag_description = " " ) {
736736 flag_count = 0 ;
737737 CLI::callback_t fun = [&flag_count](const CLI::results_t &res) {
@@ -754,7 +754,7 @@ class App {
754754 !std::is_constructible<std::function<void (int )>, T>::value,
755755 detail::enabler> = detail::dummy>
756756 Option *add_flag (std::string flag_name,
757- T &flag_result, // /< A variable holding true if passed
757+ T &flag_result, // /< A variable holding true if passed
758758 std::string flag_description = " " ) {
759759
760760 CLI::callback_t fun = [&flag_result](const CLI::results_t &res) {
@@ -768,7 +768,7 @@ class App {
768768 typename T,
769769 enable_if_t <!std::is_assignable<std::function<void (std::int64_t )>, T>::value, detail::enabler> = detail::dummy>
770770 Option *add_flag (std::string flag_name,
771- std::vector<T> &flag_results, // /< A vector of values with the flag results
771+ std::vector<T> &flag_results, // /< A vector of values with the flag results
772772 std::string flag_description = " " ) {
773773 CLI::callback_t fun = [&flag_results](const CLI::results_t &res) {
774774 bool retval = true ;
@@ -785,7 +785,7 @@ class App {
785785
786786 // / Add option for callback that is triggered with a true flag and takes no arguments
787787 Option *add_flag_callback (std::string flag_name,
788- std::function<void (void )> function, // /< A function to call, void(void)
788+ std::function<void (void )> function, // /< A function to call, void(void)
789789 std::string flag_description = "") {
790790
791791 CLI::callback_t fun = [function](const CLI::results_t &res) {
@@ -801,7 +801,7 @@ class App {
801801
802802 // / Add option for callback with an integer value
803803 Option *add_flag_function (std::string flag_name,
804- std::function<void (std::int64_t )> function, // /< A function to call, void(int)
804+ std::function<void (std::int64_t )> function, // /< A function to call, void(int)
805805 std::string flag_description = "") {
806806
807807 CLI::callback_t fun = [function](const CLI::results_t &res) {
@@ -817,7 +817,7 @@ class App {
817817#ifdef CLI11_CPP14
818818 // / Add option for callback (C++14 or better only)
819819 Option *add_flag (std::string flag_name,
820- std::function<void (std::int64_t )> function, // /< A function to call, void(std::int64_t)
820+ std::function<void (std::int64_t )> function, // /< A function to call, void(std::int64_t)
821821 std::string flag_description = "") {
822822 return add_flag_function (std::move (flag_name), std::move (function), std::move (flag_description));
823823 }
@@ -826,8 +826,8 @@ class App {
826826 // / Add set of options (No default, temp reference, such as an inline set) DEPRECATED
827827 template <typename T>
828828 Option *add_set (std::string option_name,
829- T &member, // /< The selected member of the set
830- std::set<T> options, // /< The set of possibilities
829+ T &member, // /< The selected member of the set
830+ std::set<T> options, // /< The set of possibilities
831831 std::string option_description = " " ) {
832832
833833 Option *opt = add_option (option_name, member, std::move (option_description));
@@ -838,8 +838,8 @@ class App {
838838 // / Add set of options (No default, set can be changed afterwards - do not destroy the set) DEPRECATED
839839 template <typename T>
840840 Option *add_mutable_set (std::string option_name,
841- T &member, // /< The selected member of the set
842- const std::set<T> &options, // /< The set of possibilities
841+ T &member, // /< The selected member of the set
842+ const std::set<T> &options, // /< The set of possibilities
843843 std::string option_description = " " ) {
844844
845845 Option *opt = add_option (option_name, member, std::move (option_description));
@@ -850,8 +850,8 @@ class App {
850850 // / Add set of options (with default, static set, such as an inline set) DEPRECATED
851851 template <typename T>
852852 Option *add_set (std::string option_name,
853- T &member, // /< The selected member of the set
854- std::set<T> options, // /< The set of possibilities
853+ T &member, // /< The selected member of the set
854+ std::set<T> options, // /< The set of possibilities
855855 std::string option_description,
856856 bool defaulted) {
857857
@@ -863,8 +863,8 @@ class App {
863863 // / Add set of options (with default, set can be changed afterwards - do not destroy the set) DEPRECATED
864864 template <typename T>
865865 Option *add_mutable_set (std::string option_name,
866- T &member, // /< The selected member of the set
867- const std::set<T> &options, // /< The set of possibilities
866+ T &member, // /< The selected member of the set
867+ const std::set<T> &options, // /< The set of possibilities
868868 std::string option_description,
869869 bool defaulted) {
870870
@@ -932,7 +932,7 @@ class App {
932932 // Remove existing config if present
933933 if (config_ptr_ != nullptr ) {
934934 remove_option (config_ptr_);
935- config_ptr_ = nullptr ; // need to remove the config_ptr completely
935+ config_ptr_ = nullptr ; // need to remove the config_ptr completely
936936 }
937937
938938 // Only add config if option passed
@@ -1107,7 +1107,7 @@ class App {
11071107 for (auto &sub : subcommands_) {
11081108 cnt += sub->count_all ();
11091109 }
1110- if (!get_name ().empty ()) { // for named subcommands add the number of times the subcommand was called
1110+ if (!get_name ().empty ()) { // for named subcommands add the number of times the subcommand was called
11111111 cnt += parsed_;
11121112 }
11131113 return cnt;
@@ -1881,7 +1881,7 @@ class App {
18811881 app->name_ .clear ();
18821882 }
18831883 if (app->name_ .empty ()) {
1884- app->fallthrough_ = false ; // make sure fallthrough_ is false to prevent infinite loop
1884+ app->fallthrough_ = false ; // make sure fallthrough_ is false to prevent infinite loop
18851885 app->prefix_command_ = false ;
18861886 }
18871887 // make sure the parent is set to be this object in preparation for parse
@@ -2657,14 +2657,14 @@ class App {
26572657 int max_num = op->get_items_expected_max ();
26582658
26592659 // Make sure we always eat the minimum for unlimited vectors
2660- int collected = 0 ; // total number of arguments collected
2661- int result_count = 0 ; // local variable for number of results in a single arg string
2660+ int collected = 0 ; // total number of arguments collected
2661+ int result_count = 0 ; // local variable for number of results in a single arg string
26622662 // deal with purely flag like things
26632663 if (max_num == 0 ) {
26642664 auto res = op->get_flag_value (arg_name, value);
26652665 op->add_result (res);
26662666 parse_order_.push_back (op.get ());
2667- } else if (!value.empty ()) { // --this=value
2667+ } else if (!value.empty ()) { // --this=value
26682668 op->add_result (value, result_count);
26692669 parse_order_.push_back (op.get ());
26702670 collected += result_count;
@@ -2685,11 +2685,11 @@ class App {
26852685 collected += result_count;
26862686 }
26872687
2688- if (min_num > collected) { // if we have run out of arguments and the minimum was not met
2688+ if (min_num > collected) { // if we have run out of arguments and the minimum was not met
26892689 throw ArgumentMismatch::TypedAtLeast (op->get_name (), min_num, op->get_type_name ());
26902690 }
26912691
2692- if (max_num > collected || op->get_allow_extra_args ()) { // we allow optional arguments
2692+ if (max_num > collected || op->get_allow_extra_args ()) { // we allow optional arguments
26932693 auto remreqpos = _count_remaining_positionals (true );
26942694 // we have met the minimum now optionally check up to the maximum
26952695 while ((collected < max_num || op->get_allow_extra_args ()) && !args.empty () &&
@@ -2866,7 +2866,7 @@ class App {
28662866 throw OptionNotFound (" could not locate the given Option" );
28672867 }
28682868 }
2869- }; // namespace CLI
2869+ }; // namespace CLI
28702870
28712871// / Extension of App to better manage groups of options
28722872class Option_group : public App {
@@ -3050,7 +3050,7 @@ inline std::string help(const App *app, const Error &e) {
30503050 return header;
30513051}
30523052
3053- } // namespace FailureMessage
3053+ } // namespace FailureMessage
30543054
30553055namespace detail {
30563056// / This class is simply to allow tests access to App's protected functions
@@ -3072,6 +3072,6 @@ struct AppFriend {
30723072 // / Wrap the fallthrough parent function to make sure that is working correctly
30733073 static App *get_fallthrough_parent (App *app) { return app->_get_fallthrough_parent (); }
30743074};
3075- } // namespace detail
3075+ } // namespace detail
30763076
3077- } // namespace CLI
3077+ } // namespace CLI
0 commit comments