summaryrefslogtreecommitdiff
path: root/source3/lib/readline.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-03-19 00:22:52 +0000
committerAndrew Tridgell <tridge@samba.org>2001-03-19 00:22:52 +0000
commite17e7b64175dcfc9963405a9fa3724f8d7097d89 (patch)
treeeef4b00b64ea7ff5ded424c11af81afdb476c2bc /source3/lib/readline.c
parent4c9f7ab7f6e7fecfa6e4bc5f8476251e35b8b363 (diff)
downloadsamba-e17e7b64175dcfc9963405a9fa3724f8d7097d89.tar.gz
samba-e17e7b64175dcfc9963405a9fa3724f8d7097d89.tar.bz2
samba-e17e7b64175dcfc9963405a9fa3724f8d7097d89.zip
added basic command completion support
(This used to be commit 386fdff2dfeaeef60b210ebc0b4d33a6c7b5d5ec)
Diffstat (limited to 'source3/lib/readline.c')
-rw-r--r--source3/lib/readline.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/lib/readline.c b/source3/lib/readline.c
index f0d8b1267f..4a3c5434c7 100644
--- a/source3/lib/readline.c
+++ b/source3/lib/readline.c
@@ -43,10 +43,15 @@
/****************************************************************************
display the prompt and wait for input. Call callback() regularly
****************************************************************************/
-char *smb_readline(char *prompt, void (*callback)(void))
+char *smb_readline(char *prompt, void (*callback)(void),
+ char **(completion_fn)(char *text, int start, int end))
{
char *ret;
#if HAVE_LIBREADLINE
+ if (completion_fn) {
+ rl_attempted_completion_function = completion_fn;
+ }
+
rl_event_hook = (Function *)callback;
ret = readline(prompt);
if (ret && *ret) add_history(ret);