mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 21:22:37 +01:00
client: readline callback
This commit is contained in:
parent
2d567414f1
commit
0ee51c9dab
@ -192,6 +192,29 @@ void display_command(const struct command_family *family, const char *cmd_name)
|
|||||||
|
|
||||||
static void readline_callback(char *prompt)
|
static void readline_callback(char *prompt)
|
||||||
{
|
{
|
||||||
|
HIST_ENTRY *previous_prompt;
|
||||||
|
|
||||||
|
if (!prompt) {
|
||||||
|
display_quit();
|
||||||
|
|
||||||
|
l_main_quit();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!strlen(prompt))
|
||||||
|
goto done;
|
||||||
|
|
||||||
|
previous_prompt = current_history();
|
||||||
|
if (!previous_prompt ||
|
||||||
|
(previous_prompt &&
|
||||||
|
strcmp(previous_prompt->line, prompt))) {
|
||||||
|
add_history(prompt);
|
||||||
|
}
|
||||||
|
|
||||||
|
command_process_prompt(prompt);
|
||||||
|
|
||||||
|
done:
|
||||||
l_free(prompt);
|
l_free(prompt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user