X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=command_util.sh;h=76b3445fc1557b607ef72ae9408dec38f8a54507;hp=86e0125865fdb24ceb1b42189430e7f5d31416c5;hb=8aa0f575bcca12ab63ab53141c2144448c457478;hpb=efc124e295a4df44dd4d60c856e3a3d87f645e96 diff --git a/command_util.sh b/command_util.sh index 86e01258..76b3445f 100755 --- a/command_util.sh +++ b/command_util.sh @@ -236,6 +236,10 @@ dump_array_member() echo '},' } +dump_completion() +{ + echo " {.name = \"$name_txt\", .completer = ${name_txt}_completer}, \\" +} template_loop() { @@ -305,6 +309,27 @@ com_header() done } +com_completion() +{ + + echo "#define $1 \\" + while : ; do + read_one_command + if test $ret -lt 0; then + exit 1 + fi + if test $ret -eq 0; then + break + fi + if test $template -eq 0; then + dump_completion + continue + fi + template_loop dump_completion + done + echo +} + read_header arg="$1" shift @@ -318,4 +343,7 @@ case "$arg" in "man") com_man $* ;; + "compl") + com_completion $* + ;; esac