ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
bash.h File Reference

Bash shell completion generator. More...

Go to the source code of this file.

Functions

asciichat_error_t completions_generate_bash (FILE *output)
 Generate bash completion script.
 

Detailed Description

Bash shell completion generator.

Generates bash completion scripts from the options registry.

Author
Zachary Fogg me@zf.nosp@m.o.gg
Date
January 2026

Definition in file bash.h.

Function Documentation

◆ completions_generate_bash()

asciichat_error_t completions_generate_bash ( FILE *  output)

Generate bash completion script.

Generates a complete bash completion script with option descriptions, mode detection, and value suggestions for enum options.

Parameters
outputFILE stream to write completion script to
Returns
ASCIICHAT_OK on success, error code on failure

Definition at line 367 of file bash.c.

367 {
368 if (!output) {
369 return SET_ERRNO(ERROR_INVALID_PARAM, "Output stream cannot be NULL");
370 }
371
372 bash_write_header(output);
373 asciichat_error_t err = bash_write_all_options(output);
374 if (err != ASCIICHAT_OK) {
375 return err;
376 }
377 bash_write_completion_logic(output);
378 bash_write_footer(output);
379
380 return ASCIICHAT_OK;
381}
#define SET_ERRNO(code, context_msg,...)
Set error code with custom context message and log it, returning the error code.
asciichat_error_t
Error and exit codes - unified status values (0-255)
Definition error_codes.h:49
@ ASCIICHAT_OK
Definition error_codes.h:51
@ ERROR_INVALID_PARAM

References ASCIICHAT_OK, ERROR_INVALID_PARAM, and SET_ERRNO.