Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
uni20::cli Namespace Reference

Classes

class  configuration
 Collect CLI input first, then resolve declared fallback sources after loading input attributes. More...
 
struct  output_options
 
struct  parse_policy
 Executable policy for empty invocations and usage failures. More...
 
struct  parse_result
 Owned parse outcome; parsing itself does not print, open files or terminate the process. More...
 

Enumerations

enum class  action {
  run , help , version , build_info ,
  error
}
 The executable decides whether to calculate or render an informational/error result. More...
 
enum class  no_arguments { help , run }
 Whether an empty invocation displays help or parses application defaults. More...
 

Functions

template<std::unsigned_integral T>
requires (!std::same_as<T, bool>)
CLI::Option * add_count_option (CLI::App &app, std::string names, T &value, std::string description={})
 Bind an unsigned decimal count with complete-token, negative and overflow checks.
 
template<std::signed_integral T>
CLI::Option * add_half_int_option (CLI::App &app, std::string names, basic_half_int< T > &value, std::string description={})
 Bind an exact half-integer, accepting integer, .0/.5 decimal and denominator-two fractional forms.
 
void add_output_options (CLI::App &app, output_options &options)
 Register output options on CLI11; call after initializing any application-specific defaults.
 
presentation::report_builder build_info_report (presentation::program_info const &program)
 Build application and existing Uni20 build information without running numerical initialization.
 
void configure (CLI::App &app, presentation::program_info const &program)
 Register common help/version/build-info actions on a single-command application.
 
std::vector< presentation::help_group > help_groups (CLI::App const &app)
 Project CLI11 option metadata into parser-independent semantic help groups.
 
presentation::report_builder help_report (CLI::App const &app, presentation::program_info const &program)
 Build full help from the same options used for parsing, plus application-supplied content.
 
parse_result parse (CLI::App &app, int argc, char const *const *argv, parse_policy policy={})
 Parse argc/argv, preserving CLI11's argument boundaries and help precedence.
 
presentation::report_builder result_report (CLI::App const &app, presentation::program_info const &program, parse_result const &result)
 Build the selected informational/error document; a run outcome has no document and is rejected.
 

Enumeration Type Documentation

◆ action

enum class uni20::cli::action
strong

The executable decides whether to calculate or render an informational/error result.

Enumerator
run 
help 
version 
build_info 
error 

◆ no_arguments

enum class uni20::cli::no_arguments
strong

Whether an empty invocation displays help or parses application defaults.

Enumerator
help 
run 

Function Documentation

◆ add_count_option()

template<std::unsigned_integral T>
requires (!std::same_as<T, bool>)
CLI::Option * uni20::cli::add_count_option ( CLI::App &  app,
std::string  names,
T &  value,
std::string  description = {} 
)

Bind an unsigned decimal count with complete-token, negative and overflow checks.

Bound storage must outlive parsing. Use capture_default_str() to display an initialized value; default_val() instead validates and assigns a new value, as with CLI11's variable bindings.

◆ add_half_int_option()

template<std::signed_integral T>
CLI::Option * uni20::cli::add_half_int_option ( CLI::App &  app,
std::string  names,
basic_half_int< T > &  value,
std::string  description = {} 
)

Bind an exact half-integer, accepting integer, .0/.5 decimal and denominator-two fractional forms.

Bound storage must outlive parsing. Non-half-integral values are rejected, never rounded. Use capture_default_str() to display an initialized value, or default_val() to validate and assign one.

◆ add_output_options()

void uni20::cli::add_output_options ( CLI::App &  app,
output_options &  options 
)
inline

Register output options on CLI11; call after initializing any application-specific defaults.

The options object must outlive parsing. This opens no files and changes no display router.

◆ build_info_report()

presentation::report_builder uni20::cli::build_info_report ( presentation::program_info const &  program)

Build application and existing Uni20 build information without running numerical initialization.

◆ configure()

void uni20::cli::configure ( CLI::App &  app,
presentation::program_info const &  program 
)

Register common help/version/build-info actions on a single-command application.

Call once before parsing. Ordinary options retain normal CLI11 registration. Application callbacks must not initialize solvers or open outputs during parsing; do that after a run outcome.

◆ help_groups()

std::vector< presentation::help_group > uni20::cli::help_groups ( CLI::App const &  app)

Project CLI11 option metadata into parser-independent semantic help groups.

◆ help_report()

presentation::report_builder uni20::cli::help_report ( CLI::App const &  app,
presentation::program_info const &  program 
)

Build full help from the same options used for parsing, plus application-supplied content.

◆ parse()

parse_result uni20::cli::parse ( CLI::App &  app,
int  argc,
char const *const *  argv,
parse_policy  policy = {} 
)

Parse argc/argv, preserving CLI11's argument boundaries and help precedence.

Catches CLI11 parse outcomes only; construction and unrelated application exceptions propagate.

◆ result_report()

presentation::report_builder uni20::cli::result_report ( CLI::App const &  app,
presentation::program_info const &  program,
parse_result const &  result 
)

Build the selected informational/error document; a run outcome has no document and is rejected.