ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
option_metadata_t Struct Reference

Completion metadata attached to one option descriptor. More...

#include <include/ascii-chat/options/builder.h>

Data Fields

const char ** enum_values
const char ** enum_descriptions
const int * enum_integer_values
struct { 
   int   min 
 Minimum value (or 0 if no limit). More...
   int   max 
 Maximum value (or 0 if no limit). More...
   int   step 
 Step size (0 = no step, continuous). More...
} numeric_range
const char ** examples
const char * default_value
 Default value as string for display.
option_input_type_t input_type
 What kind of input this option expects.
bool is_list
const char * validation_pattern
 Optional regex pattern for validation hints.

Detailed Description

Completion metadata attached to one option descriptor.

Stores additional information about options to enable smart shell completions with value suggestions, numeric ranges, examples, etc. This data is used by all shell completion generators (bash, fish, zsh, powershell).

Definition at line 213 of file builder.h.

Field Documentation

◆ default_value

const char* option_metadata_t::default_value

Default value as string for display.

Definition at line 236 of file builder.h.

◆ enum_descriptions

const char** option_metadata_t::enum_descriptions

Descriptions parallel to enum_values (null-terminated, e.g., "Auto-detect from terminal")

Definition at line 218 of file builder.h.

Referenced by options_get_enum_entries(), and options_registry_get_enum_values().

◆ enum_integer_values

const int* option_metadata_t::enum_integer_values

Actual enum integer values (e.g., {-1, 0, 1, 2, 3} for non-sequential enums)

Definition at line 221 of file builder.h.

Referenced by options_get_enum_entries().

◆ enum_values

const char* * option_metadata_t::enum_values

Enum value strings (null-terminated, e.g., {"auto", "none", "16", "256", "truecolor", NULL})

Definition at line 216 of file builder.h.

Referenced by options_get_enum_entries(), options_json_schema_for_option(), options_json_schema_for_option(), options_registry_get_enum_values(), and registry_add_all_to_flags_builder().

◆ examples

const char** option_metadata_t::examples

Example values or command invocations (null-terminated array)

Definition at line 232 of file builder.h.

Referenced by options_registry_get_examples().

◆ input_type

option_input_type_t option_metadata_t::input_type

What kind of input this option expects.

Definition at line 239 of file builder.h.

Referenced by options_registry_get_enum_values(), options_registry_get_input_type(), and options_registry_get_numeric_range().

◆ is_list

bool option_metadata_t::is_list

If true, option accepts multiple comma-separated or space-separated values

Definition at line 242 of file builder.h.

◆ max

int option_metadata_t::max

Maximum value (or 0 if no limit).

Definition at line 227 of file builder.h.

Referenced by config_schema_build_from_configs(), and options_registry_get_numeric_range().

◆ min

int option_metadata_t::min

Minimum value (or 0 if no limit).

Definition at line 226 of file builder.h.

Referenced by config_schema_build_from_configs(), and options_registry_get_numeric_range().

◆ [struct]

struct { ... } option_metadata_t::numeric_range

◆ step

int option_metadata_t::step

Step size (0 = no step, continuous).

Definition at line 228 of file builder.h.

Referenced by options_registry_get_numeric_range().

◆ validation_pattern

const char* option_metadata_t::validation_pattern

Optional regex pattern for validation hints.

Definition at line 247 of file builder.h.

Referenced by registry_add_all_to_flags_builder().


The documentation for this struct was generated from the following file: