ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
option_descriptor_t Struct Reference

The complete registry entry for one command-line/configuration option. More...

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

Data Fields

const char * long_name
 Long option name (e.g., "port").
char short_name
 Short option char (e.g., 'p', or '\0' if none).
option_type_t type
 Value type.
size_t offset
 offsetof(struct, field) - where to store value
const char * help_text
 Description for –help.
const char * group
 Group name for help sections (e.g., "NETWORK OPTIONS").
const char * arg_placeholder
 Custom argument placeholder (e.g., "SHELL [FILE]" instead of "STR").
bool hide_from_mode_help
 If true, don't show in mode-specific help (binary-level only).
bool hide_from_binary_help
 If true, don't show in binary-level help (e.g., in release builds).
const void * default_value
 Pointer to default value (or NULL if required).
bool required
 If true, option must be provided.
const char * env_var_name
 Environment variable fallback (or NULL).
bool(* validate )(const void *options_struct)
bool(* parse_fn )(const char *arg, void *dest, char **error_msg)
void(* action_fn )(void)
 Action to execute (may call exit).
bool owns_memory
 If true, strings are strdup'd and freed on cleanup.
bool optional_arg
 If true, argument is optional (for callbacks like –verbose).
option_mode_bitmask_t mode_bitmask
 Which modes this option applies to.
option_metadata_t metadata
 Metadata for shell completions (enums, ranges, examples, etc.).
const void *(* mode_default_getter )(asciichat_mode_t mode)
 Get mode-specific default value (NULL if not mode-aware).

Detailed Description

The complete registry entry for one command-line/configuration option.

Describes a single command-line option with all its metadata. Includes both parsing information and completion metadata for generating smart shell completions.

Definition at line 249 of file builder.h.

Field Documentation

◆ action_fn

void(* option_descriptor_t::action_fn) (void)

Action to execute (may call exit).

Definition at line 277 of file builder.h.

Referenced by registry_entry_to_descriptor().

◆ arg_placeholder

const char* option_descriptor_t::arg_placeholder

Custom argument placeholder (e.g., "SHELL [FILE]" instead of "STR").

Definition at line 261 of file builder.h.

Referenced by manpage_content_generate_options(), and registry_entry_to_descriptor().

◆ default_value

const void* option_descriptor_t::default_value

Pointer to default value (or NULL if required).

Definition at line 266 of file builder.h.

Referenced by manpage_content_generate_options(), and registry_entry_to_descriptor().

◆ env_var_name

const char* option_descriptor_t::env_var_name

◆ group

const char* option_descriptor_t::group

Group name for help sections (e.g., "NETWORK OPTIONS").

Definition at line 260 of file builder.h.

Referenced by config_schema_build_from_configs(), manpage_content_generate_options(), and registry_entry_to_descriptor().

◆ help_text

◆ hide_from_binary_help

bool option_descriptor_t::hide_from_binary_help

If true, don't show in binary-level help (e.g., in release builds).

Definition at line 263 of file builder.h.

Referenced by manpage_content_generate_options(), and registry_entry_to_descriptor().

◆ hide_from_mode_help

bool option_descriptor_t::hide_from_mode_help

If true, don't show in mode-specific help (binary-level only).

Definition at line 262 of file builder.h.

Referenced by manpage_content_generate_options(), and registry_entry_to_descriptor().

◆ long_name

◆ metadata

option_metadata_t option_descriptor_t::metadata

Metadata for shell completions (enums, ranges, examples, etc.).

Definition at line 289 of file builder.h.

Referenced by config_schema_build_from_configs(), and registry_entry_to_descriptor().

◆ mode_bitmask

option_mode_bitmask_t option_descriptor_t::mode_bitmask

◆ mode_default_getter

const void *(* option_descriptor_t::mode_default_getter) (asciichat_mode_t mode)

Get mode-specific default value (NULL if not mode-aware).

Definition at line 292 of file builder.h.

Referenced by config_schema_build_from_configs(), and registry_entry_to_descriptor().

◆ offset

size_t option_descriptor_t::offset

offsetof(struct, field) - where to store value

Definition at line 256 of file builder.h.

Referenced by config_schema_build_from_configs(), options_json_parse_value(), and registry_entry_to_descriptor().

◆ optional_arg

bool option_descriptor_t::optional_arg

If true, argument is optional (for callbacks like –verbose).

Definition at line 283 of file builder.h.

Referenced by completions_generate_zsh(), and registry_entry_to_descriptor().

◆ owns_memory

bool option_descriptor_t::owns_memory

If true, strings are strdup'd and freed on cleanup.

Definition at line 280 of file builder.h.

Referenced by registry_entry_to_descriptor().

◆ parse_fn

bool(* option_descriptor_t::parse_fn) (const char *arg, void *dest, char **error_msg)

Definition at line 274 of file builder.h.

Referenced by config_schema_build_from_configs(), and registry_entry_to_descriptor().

◆ required

bool option_descriptor_t::required

If true, option must be provided.

Definition at line 267 of file builder.h.

Referenced by manpage_content_generate_options(), and registry_entry_to_descriptor().

◆ short_name

char option_descriptor_t::short_name

Short option char (e.g., 'p', or '\0' if none).

Definition at line 252 of file builder.h.

Referenced by completions_generate_zsh(), manpage_content_generate_options(), and registry_entry_to_descriptor().

◆ type

◆ validate

bool(* option_descriptor_t::validate) (const void *options_struct)

Definition at line 271 of file builder.h.

Referenced by config_schema_build_from_configs(), and registry_entry_to_descriptor().


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