|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
Help text generation and formatting for options. More...
Go to the source code of this file.
Functions | |
| int | options_config_calculate_max_col_width (const options_config_t *config) |
| Calculate global max column width across all help sections. | |
| void | options_config_print_usage (const options_config_t *config, FILE *stream) |
| void | options_config_print_usage_section (const options_config_t *config, FILE *stream) |
| Print only the USAGE section. | |
| void | options_config_print_options_sections_with_width (const options_config_t *config, FILE *stream, int max_col_width, asciichat_mode_t mode) |
| Print everything except the USAGE section. | |
| void | options_config_print_options_sections (const options_config_t *config, FILE *stream, asciichat_mode_t mode) |
| Print everything except the USAGE section (backward compatibility wrapper) | |
| void | options_print_help_for_mode (const options_config_t *config, asciichat_mode_t mode, const char *program_name, const char *description, FILE *desc) |
| Print help for a specific mode or binary level. | |
| void | options_struct_destroy (const options_config_t *config, void *options_struct) |
Help text generation and formatting for options.
Implements all help/usage text generation functions including programmatic section printers and unified help output.
Definition in file help.c.
| int options_config_calculate_max_col_width | ( | const options_config_t * | config | ) |
Calculate global max column width across all help sections.
Calculates the maximum width needed for proper alignment across USAGE, EXAMPLES, OPTIONS, and MODES sections.
Definition at line 76 of file help.c.
References colored_string(), safe_snprintf(), usage(), and utf8_display_width().
Referenced by options_config_print_options_sections_with_width(), and options_config_print_usage_section().
| void options_config_print_options_sections | ( | const options_config_t * | config, |
| FILE * | stream, | ||
| asciichat_mode_t | mode | ||
| ) |
Print everything except the USAGE section (backward compatibility wrapper)
Calls options_config_print_options_sections_with_width with auto-calculation.
Definition at line 1074 of file help.c.
References options_config_print_options_sections_with_width().
| void options_config_print_options_sections_with_width | ( | const options_config_t * | config, |
| FILE * | stream, | ||
| int | max_col_width, | ||
| asciichat_mode_t | mode | ||
| ) |
Print everything except the USAGE section.
Prints MODES, MODE-OPTIONS, EXAMPLES, and OPTIONS sections. Used with options_config_print_usage_section to allow custom content in between.
Definition at line 883 of file help.c.
References colored_string(), format_option_default_value_str(), get_option_help_placeholder_str(), layout_print_two_column_row(), option_applies_to_mode(), options_config_calculate_max_col_width(), safe_snprintf(), and terminal_get_size().
Referenced by options_config_print_options_sections(), and options_print_help_for_mode().
| void options_config_print_usage | ( | const options_config_t * | config, |
| FILE * | stream | ||
| ) |
Definition at line 707 of file help.c.
References colored_string(), format_option_default_value_str(), get_option_help_placeholder_str(), layout_print_two_column_row(), option_applies_to_mode(), and safe_snprintf().
| void options_config_print_usage_section | ( | const options_config_t * | config, |
| FILE * | stream | ||
| ) |
Print only the USAGE section.
Splits usage printing from other sections to allow custom content (like positional argument examples) to be inserted between USAGE and other sections.
Definition at line 857 of file help.c.
References options_config_calculate_max_col_width().
| void options_print_help_for_mode | ( | const options_config_t * | config, |
| asciichat_mode_t | mode, | ||
| const char * | program_name, | ||
| const char * | description, | ||
| FILE * | desc | ||
| ) |
Print help for a specific mode or binary level.
This is the single unified function for all help output (binary level and all modes). It handles common layout logic, terminal detection, and section printing.
| config | Options config with all options (binary + all modes) |
| mode | Mode to show help for (use -1 for binary-level help) |
| program_name | Full program name with mode (e.g., "ascii-chat server") |
| description | Brief description of the mode/binary |
| desc | Output file stream (usually stdout) |
Definition at line 1094 of file help.c.
References colored_string(), layout_print_two_column_row(), layout_print_wrapped_description(), options_config_print_options_sections_with_width(), print_project_links(), safe_snprintf(), terminal_get_size(), and usage().
Referenced by usage().
| void options_struct_destroy | ( | const options_config_t * | config, |
| void * | options_struct | ||
| ) |
Definition at line 1424 of file help.c.