Basic support for custom completion handlers with the two "standard"

rl_complete() and rl_list_possib().  Simply leave out complete.o from
the default build and in all programs require these two functions to
be supplied.

A better alternative would be to use function pointers and check those
for NULL in the running code.  With this code, and no completion handler
the editline code will die.
This commit is contained in:
Joachim Nilsson
2008-10-02 01:52:40 +02:00
parent 4a3fbd9187
commit 5c9f0047bb
7 changed files with 164 additions and 13 deletions

View File

@@ -40,4 +40,19 @@ AC_PROG_GCC_TRADITIONAL
AC_FUNC_STAT
AC_CHECK_FUNCS([strchr strdup strrchr tcgetattr])
AC_ARG_ENABLE([complete],
[ --enable-default-complete Enable default completion handler.],[
case "${enableval}" in
yes)
complete=true
;;
no)
complete=false
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-default-complete])
;;
esac],[complete=false])
AM_CONDITIONAL([COMPLETE], [test x$complete = xtrue])
AC_OUTPUT(Makefile src/Makefile include/Makefile man/Makefile examples/Makefile)