GNU Readline related functions.
More...
|
#define | COLOR_OFF "\x1b[0m" |
| Reset color (ANSI sequence)
|
|
#define | COLOR_BOLD "\x1b[1m" |
| Set font to bold (ANSI sequence)
|
|
#define | CLI_PROMPT "(" COLOR_BOLD "pbc" COLOR_OFF ") " |
| Prompt text.
|
|
|
int | cli_main () |
| CLI entrypoint.
|
|
void | rl_printf (const char *fmt,...) |
| Print format string to stdout without disturbing the readline prompt.
|
|
int | rl_word (const char *line, int cursor) |
| Get the index of the word currently under the cursor.
|
|
char ** | rl_complete_list (const char *word, const char *options[]) |
| Create a completion suggestion string array for readline.
|
|
◆ rl_complete_list()
char ** rl_complete_list |
( |
const char * | word, |
|
|
const char * | options[] ) |
- Parameters
-
word | Word to complete |
options | List of possible choices (NULL terminated array of strings) |
- Returns
- Suggestions matching
word
◆ rl_printf()
void rl_printf |
( |
const char * | fmt, |
|
|
| ... ) |
This function saves and restores the current readline prompt before/after calling printf. This function is not required for commands that print output synchronously, as the prompt is only shown after a command handler completes.
◆ rl_word()
int rl_word |
( |
const char * | line, |
|
|
int | cursor ) |
- Parameters
-
line | Command line contents |
cursor | Index of cursor position |
This function returns the index of the word from an array made by splitting line
on consecutive occurrences of IFS
.
- Returns
- Index of word