From 79cb12eaef96d4e1308ab68d32d0c294f03c7fa2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 2 Nov 2022 03:11:27 +0000 Subject: [PATCH] Upgrade CLI11 to 2.3.1 (#3301) --- .../bindings/cli/third_party/CLI/CLI11.hpp | 65 +++++++++++-------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/src/mlpack/bindings/cli/third_party/CLI/CLI11.hpp b/src/mlpack/bindings/cli/third_party/CLI/CLI11.hpp index b7387acf79..739fd8bd5e 100644 --- a/src/mlpack/bindings/cli/third_party/CLI/CLI11.hpp +++ b/src/mlpack/bindings/cli/third_party/CLI/CLI11.hpp @@ -1,11 +1,11 @@ -// CLI11: Version 2.3.0 +// CLI11: Version 2.3.1 // Originally designed by Henry Schreiner // https://github.com/CLIUtils/CLI11 // // This is a standalone header file generated by MakeSingleHeader.py in CLI11/scripts -// from: v2.3.0 +// from: v2.3.1 // -// CLI11 2.3.0 Copyright (c) 2017-2022 University of Cincinnati, developed by Henry +// CLI11 2.3.1 Copyright (c) 2017-2022 University of Cincinnati, developed by Henry // Schreiner under NSF AWARD 1414736. All rights reserved. // // Redistribution and use in source and binary forms of CLI11, with or without @@ -34,34 +34,34 @@ #pragma once // Standard combined includes: -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include +#include +#include #include -#include #include +#include +#include +#include +#include +#include +#include +#include #include -#include #include +#include +#include +#include +#include +#include +#include +#include #define CLI11_VERSION_MAJOR 2 #define CLI11_VERSION_MINOR 3 -#define CLI11_VERSION_PATCH 0 -#define CLI11_VERSION "2.3.0" +#define CLI11_VERSION_PATCH 1 +#define CLI11_VERSION "2.3.1" @@ -2671,7 +2671,7 @@ class Config { if(item.inputs.empty()) { return "{}"; } - throw ConversionError::TooManyInputsFlag(item.fullname()); + throw ConversionError::TooManyInputsFlag(item.fullname()); // LCOV_EXCL_LINE } /// Parse a config file, throw an error (ParseError:ConfigParseError or FileError) on failure @@ -3478,7 +3478,7 @@ class AsNumberWithUnit : public Validator { // transform function func_ = [mapping, opts](std::string &input) -> std::string { - Number num; + Number num{}; detail::rtrim(input); if(input.empty()) { @@ -3742,7 +3742,7 @@ CLI11_INLINE path_type check_path(const char *file) noexcept { return path_type::nonexistent; } switch(stat.type()) { - case std::filesystem::file_type::none: + case std::filesystem::file_type::none: // LCOV_EXCL_LINE case std::filesystem::file_type::not_found: return path_type::nonexistent; case std::filesystem::file_type::directory: @@ -3993,6 +3993,8 @@ class FormatterBase { FormatterBase() = default; FormatterBase(const FormatterBase &) = default; FormatterBase(FormatterBase &&) = default; + FormatterBase &operator=(const FormatterBase &) = default; + FormatterBase &operator=(FormatterBase &&) = default; /// Adding a destructor in this form to work around bug in GCC 4.7 virtual ~FormatterBase() noexcept {} // NOLINT(modernize-use-equals-default) @@ -4054,6 +4056,8 @@ class Formatter : public FormatterBase { Formatter() = default; Formatter(const Formatter &) = default; Formatter(Formatter &&) = default; + Formatter &operator=(const Formatter &) = default; + Formatter &operator=(Formatter &&) = default; /// @name Overridables ///@{ @@ -7307,6 +7311,15 @@ CLI11_NODISCARD CLI11_INLINE CLI::App_p App::get_subcommand_ptr(int index) const throw OptionNotFound(std::to_string(index)); } +CLI11_NODISCARD CLI11_INLINE CLI::App *App::get_option_group(std::string group_name) const { + for(const App_p &app : subcommands_) { + if(app->name_.empty() && app->group_ == group_name) { + return app.get(); + } + } + throw OptionNotFound(group_name); +} + CLI11_NODISCARD CLI11_INLINE std::size_t App::count_all() const { std::size_t cnt{0}; for(const auto &opt : options_) { @@ -9469,7 +9482,7 @@ CLI11_INLINE std::string Formatter::make_footer(const App *app) const { if(footer.empty()) { return std::string{}; } - return footer + "\n"; + return "\n" + footer + "\n"; } CLI11_INLINE std::string Formatter::make_help(const App *app, std::string name, AppFormatMode mode) const { @@ -9491,7 +9504,7 @@ CLI11_INLINE std::string Formatter::make_help(const App *app, std::string name, out << make_positionals(app); out << make_groups(app, mode); out << make_subcommands(app, mode); - out << '\n' << make_footer(app); + out << make_footer(app); return out.str(); }