#!/bin/tcsh

#? NAME
#?      $0  -  tcsh completion function for o-saft, o-saft.pl, o-saft-tcl
#?
#? DESCRIPTION
#?      This tcsh function provides values to be used in tcsh's completion
#?      (see tcsh's complete  key).
#?
#? USAGE
#?      source tcsh_completion_o-saft
#?
#? SEE ALSO
#?      http://hyperpolyglot.org/unix-shells
#?      http://www.tcsh.org/tcsh.html/Builtin_commands.html#complete
#?      Get inspired by:
#?      http://www.opensource.apple.com/source/tcsh/tcsh-64/tcsh/complete.tcsh
#?
#? VERSION
#?      @(#) tcsh_completion_o-saft 1.6 25/01/10 16:46:35
#?
#? AUTHOR
#?      14. December 2014 Achim Hoffmann
# ------------------------------------------------------------------------------

complete o-saft \
	'C@+@`o-saft    --help=commands|awk /^\\+/\{print\ \$1\}`@' \
	'C@-@`o-saft    --help=opts    |awk /^\\-/\{print\ \$1\}`@' \

complete o-saft.pl \
	'C@+@`o-saft.pl --help=commands|awk /^\\+/\{print\ \$1\}`@' \
	'C@-@`o-saft.pl --help=opts    |awk /^\\-/\{print\ \$1\}`@' \

complete o-saft.tcl \
	'C@+@`o-saft.tcl --help=opts   |awk /^\\+/\{print\ \$1\}`@' \
	'C@-@`o-saft.tcl --help=opts   |awk /^\\-/\{print\ \$1\}`@' \

# not all, but most are provided for make
complete make \
	'C@help@`make  e-ALL.help      |tr -s " " \\012`@' \
	'C@test@`make  e-ALL.tests     |tr -s " " \\012`@' \
	'C@warn@`make  e-ALL.tests     |tr -s " " \\012`@' \

# NOTE: Some tcsh's man-pages state that ` (backtick) needs to be esacped in
#       the substitute part. This seems to be wrong.
