Qore linenoise Module
1.0.0
|
Functions | |
int | Qore::Linenoise::columns () |
Get terminal width in characters. More... | |
list | Qore::Linenoise::history () |
Get complete history. More... | |
int | Qore::Linenoise::history_add (string line) |
Add string to history. More... | |
nothing | Qore::Linenoise::history_free () |
Clear the history. | |
int | Qore::Linenoise::history_get_max_len () |
get size of the history More... | |
nothing | Qore::Linenoise::history_load (string filename) |
Load history from file. More... | |
nothing | Qore::Linenoise::history_save (string filename) |
Save history to file. More... | |
int | Qore::Linenoise::history_set_max_len (int len) |
Set size of the history. More... | |
string | Qore::Linenoise::line (string prompt) |
Main function to obtain line value. More... | |
nothing | Qore::Linenoise::set_callback (code callback) |
Set auto-completion callback function. More... | |
int Qore::Linenoise::columns | ( | ) |
Get terminal width in characters.
list Qore::Linenoise::history | ( | ) |
Get complete history.
Get complete history. History structure is limited by Qore::Linenoise::history_set_max_len()
int Qore::Linenoise::history_add | ( | string | line | ) |
Add string to history.
It adds new item to history. The history queue is shifted if it hits the maximum history size.
line | a string to be added |
int Qore::Linenoise::history_get_max_len | ( | ) |
get size of the history
nothing Qore::Linenoise::history_load | ( | string | filename | ) |
Load history from file.
Load history queue from plain-text file.
filename | a filename with relative or full path |
LINENOISE-HISTORY-LOAD-ERROR |
nothing Qore::Linenoise::history_save | ( | string | filename | ) |
Save history to file.
Save history queue to plain-text file.
filename | a filename with relative or full path |
LINENOISE-HISTORY-SAVE-ERROR |
int Qore::Linenoise::history_set_max_len | ( | int | len | ) |
Set size of the history.
len | a new size |
string Qore::Linenoise::line | ( | string | prompt | ) |
Main function to obtain line value.
The function waits for user input confirmed by Enter.
prompt | a custom string with prompt |
Features:
Example:
nothing Qore::Linenoise::set_callback | ( | code | callback | ) |
Set auto-completion callback function.
code | a funnction/method reference or a closure to handle completion callback |
RUNTIME-OVERLOAD-ERROR
exception will be thrown