cli20 0.1.2
A C++20 typed-schema command-line parser
Loading...
Searching...
No Matches
cli::ArgumentSpec Concept Reference

Concept that validates an aggregate type as a well-formed CLI argument specification. More...

#include <argument.hh>

Concept definition

template<class T>
concept ArgumentSpec = requires {
requires detail::members_are_derived_from_valid_cli_class<T>();
requires detail::options_have_unique_long_name<T>();
requires detail::options_have_unique_short_name<T>();
requires detail::commands_have_unique_long_name<T>();
requires detail::positionals_have_variadic_at_end<T>();
requires detail::relations_are_well_formed<T>();
}
Concept that validates an aggregate type as a well-formed CLI argument specification.
Definition argument.hh:38

Detailed Description

Concept that validates an aggregate type as a well-formed CLI argument specification.

A type satisfies ArgumentSpec when all of the following hold:

  • All members derive from SpecMemberTag.
  • All option long names are unique.
  • All option short names are unique (ignoring '\0').
  • All command names are unique.
  • Variadic positionals appear only at the end of the positional list.

Violations are reported as compile-time errors via static_assert inside the individual consteval checks.

Template Parameters
TThe aggregate struct to validate.

Definition at line 38 of file argument.hh.