ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
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 379 of file bash.c.

379 {
380 if (!output) {
381 return SET_ERRNO(ERROR_INVALID_PARAM, "Output stream cannot be NULL");
382 }
383
384 bash_write_header(output);
385 asciichat_error_t err = bash_write_all_options(output);
386 if (err != ASCIICHAT_OK) {
387 return err;
388 }
389 bash_write_completion_logic(output);
390 bash_write_footer(output);
391
392 return ASCIICHAT_OK;
393}
#define SET_ERRNO(code,...)
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:44
@ ASCIICHAT_OK
Definition error_codes.h:46
@ ERROR_INVALID_PARAM

References ASCIICHAT_OK, ERROR_INVALID_PARAM, and SET_ERRNO.