cli20 0.1.2
A C++20 typed-schema command-line parser
Loading...
Searching...
No Matches
constraint.hh File Reference
#include <concepts>
#include <optional>
#include <string>
#include <string_view>
#include "cli/error.hh"

Go to the source code of this file.

Classes

struct  cli::ConstraintResult
 The result type returned by a constraints() post-parse hook. More...

Namespaces

namespace  cli
namespace  cli::constraint
 Post-parse constraint helpers.

Functions

template<detail::NamedProviderArg... Args>
auto cli::constraint::one_of (const Args &... args) -> ConstraintResult
 Exactly one of the listed options must be provided.
template<detail::NamedProviderArg... Args>
auto cli::constraint::at_most_one_of (const Args &... args) -> ConstraintResult
 At most one of the listed options may be provided.
template<detail::NamedProviderArg... Args>
auto cli::constraint::all_of (const Args &... args) -> ConstraintResult
 All of the listed options must be provided.
template<detail::NamedProviderArg... Args>
auto cli::constraint::all_or_none (const Args &... args) -> ConstraintResult
 Either all of the listed options must be provided, or none.
template<detail::NamedProviderArg Cond, detail::NamedProviderArg Req>
auto cli::constraint::requires_if (const Cond &condition, const Req &required) -> ConstraintResult
 If condition is provided, required must also be provided.