Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/CLI11/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CLI11 2.2 Copyright (c) 2017-2024 University of Cincinnati, developed by Henry
CLI11 2.6.2 Copyright (c) 2017-2026 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
Expand Down
2 changes: 1 addition & 1 deletion contrib/CLI11/README.contrib
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Source: https://github.com/CLIUtils/CLI11
Revision: v2.4.2
Revision: v2.6.2
427 changes: 305 additions & 122 deletions contrib/CLI11/README.md

Large diffs are not rendered by default.

189 changes: 151 additions & 38 deletions contrib/CLI11/include/CLI/App.hpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contrib/CLI11/include/CLI/Argv.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner
// Copyright (c) 2017-2026, University of Cincinnati, developed by Henry Schreiner
// under NSF AWARD 1414736 and by the respective contributors.
// All rights reserved.
//
Expand Down
4 changes: 3 additions & 1 deletion contrib/CLI11/include/CLI/CLI.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner
// Copyright (c) 2017-2026, University of Cincinnati, developed by Henry Schreiner
// under NSF AWARD 1414736 and by the respective contributors.
// All rights reserved.
//
Expand Down Expand Up @@ -41,4 +41,6 @@

#include "Formatter.hpp"

#include "ExtraValidators.hpp"

// IWYU pragma: end_exports
2 changes: 1 addition & 1 deletion contrib/CLI11/include/CLI/Config.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner
// Copyright (c) 2017-2026, University of Cincinnati, developed by Henry Schreiner
// under NSF AWARD 1414736 and by the respective contributors.
// All rights reserved.
//
Expand Down
27 changes: 24 additions & 3 deletions contrib/CLI11/include/CLI/ConfigFwd.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner
// Copyright (c) 2017-2026, University of Cincinnati, developed by Henry Schreiner
// under NSF AWARD 1414736 and by the respective contributors.
// All rights reserved.
//
Expand All @@ -16,7 +16,7 @@
#include <string>
#include <vector>
// [CLI11:public_includes:end]

#include "Encoding.hpp"
#include "Error.hpp"
#include "StringTools.hpp"

Expand All @@ -34,12 +34,14 @@ struct ConfigItem {
std::string name{};
/// Listing of inputs
std::vector<std::string> inputs{};

/// @brief indicator if a multiline vector separator was inserted
bool multiline{false};
/// The list of parents and name joined by "."
CLI11_NODISCARD std::string fullname() const {
std::vector<std::string> tmp = parents;
tmp.emplace_back(name);
return detail::join(tmp, ".");
(void)multiline; // suppression for cppcheck false positive
}
};

Expand Down Expand Up @@ -68,7 +70,12 @@ class Config {

/// Parse a config file, throw an error (ParseError:ConfigParseError or FileError) on failure
CLI11_NODISCARD std::vector<ConfigItem> from_file(const std::string &name) const {
#if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0
std::ifstream input{to_path(name)};
#else
std::ifstream input{name};
#endif

if(!input.good())
throw FileError::Missing(name);

Expand Down Expand Up @@ -100,6 +107,10 @@ class ConfigBase : public Config {
uint8_t maximumLayers{255};
/// the separator used to separator parent layers
char parentSeparatorChar{'.'};
/// comment default values
bool commentDefaultsBool = false;
/// specify the config reader should collapse repeated field names to a single vector
bool allowMultipleDuplicateFields{false};
/// Specify the configuration index to use for arrayed sections
int16_t configIndex{-1};
/// Specify the configuration section that should be used
Expand Down Expand Up @@ -147,6 +158,11 @@ class ConfigBase : public Config {
parentSeparatorChar = sep;
return this;
}
/// comment default value options
ConfigBase *commentDefaults(bool comDef = true) {
commentDefaultsBool = comDef;
return this;
}
/// get a reference to the configuration section
std::string &sectionRef() { return configSection; }
/// get the section
Expand All @@ -166,6 +182,11 @@ class ConfigBase : public Config {
configIndex = sectionIndex;
return this;
}
/// specify that multiple duplicate arguments should be merged even if not sequential
ConfigBase *allowDuplicateFields(bool value = true) {
allowMultipleDuplicateFields = value;
return this;
}
};

/// the default Config is the TOML file format
Expand Down
2 changes: 1 addition & 1 deletion contrib/CLI11/include/CLI/Encoding.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner
// Copyright (c) 2017-2026, University of Cincinnati, developed by Henry Schreiner
// under NSF AWARD 1414736 and by the respective contributors.
// All rights reserved.
//
Expand Down
16 changes: 8 additions & 8 deletions contrib/CLI11/include/CLI/Error.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner
// Copyright (c) 2017-2026, University of Cincinnati, developed by Henry Schreiner
// under NSF AWARD 1414736 and by the respective contributors.
// All rights reserved.
//
Expand Down Expand Up @@ -41,7 +41,7 @@ namespace CLI {

/// These codes are part of every error in CLI. They can be obtained from e using e.exit_code or as a quick shortcut,
/// int values from e.get_error_code().
enum class ExitCodes {
enum class ExitCodes : int {
Success = 0,
IncorrectConstruction = 100,
BadNameString,
Expand Down Expand Up @@ -132,8 +132,8 @@ class BadNameString : public ConstructionError {
static BadNameString BadPositionalName(std::string name) {
return BadNameString("Invalid positional Name: " + name);
}
static BadNameString DashesOnly(std::string name) {
return BadNameString("Must have a name, not just dashes: " + name);
static BadNameString ReservedName(std::string name) {
return BadNameString("Names '-','--','++' are reserved and not allowed as option names " + name);
}
static BadNameString MultiPositionalNames(std::string name) {
return BadNameString("Only one positional name allowed, remove: " + name);
Expand Down Expand Up @@ -275,7 +275,7 @@ class ArgumentMismatch : public ParseError {
std::to_string(received));
}
static ArgumentMismatch AtMost(std::string name, int num, std::size_t received) {
return ArgumentMismatch(name + ": At Most " + std::to_string(num) + " required but received " +
return ArgumentMismatch(name + ": At most " + std::to_string(num) + " required but received " +
std::to_string(received));
}
static ArgumentMismatch TypedAtLeast(std::string name, int num, std::string type) {
Expand Down Expand Up @@ -310,13 +310,13 @@ class ExtrasError : public ParseError {
explicit ExtrasError(std::vector<std::string> args)
: ExtrasError((args.size() > 1 ? "The following arguments were not expected: "
: "The following argument was not expected: ") +
detail::rjoin(args, " "),
detail::join(args, " "),
ExitCodes::ExtrasError) {}
ExtrasError(const std::string &name, std::vector<std::string> args)
: ExtrasError(name,
(args.size() > 1 ? "The following arguments were not expected: "
: "The following argument was not expected: ") +
detail::rjoin(args, " "),
detail::join(args, " "),
ExitCodes::ExtrasError) {}
};

Expand Down Expand Up @@ -347,7 +347,7 @@ class HorribleError : public ParseError {

// After parsing

/// Thrown when counting a non-existent option
/// Thrown when counting a nonexistent option
class OptionNotFound : public Error {
CLI11_ERROR_DEF(Error, OptionNotFound)
explicit OptionNotFound(std::string name) : OptionNotFound(name + " not found", ExitCodes::OptionNotFound) {}
Expand Down
Loading
Loading