3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
6 # T2 SDE: package/.../bashcompletion/usr_bin_bashcomp.sh
7 # Copyright (C) 2004 - 2005 The T2 SDE Project
8 # Copyright (C) 1998 - 2004 ROCK Linux Project
10 # More information can be found in the files COPYING and README.
12 # This program is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; version 2 of the License. A copy of the
15 # GNU General Public License can be found in the file COPYING.
16 # --- T2-COPYRIGHT-NOTE-END ---
20 .
/etc
/bash_completion
21 complete |
sed "s, -F \([^ ]*\), -C '$0 \1',"
23 tmpfile
=$
( mktemp
$HOME/.bashcomp.XXXXXXXXXX
)
25 mv $tmpfile $HOME/.bashcomp.cache
27 # Have: COMP_LINE COMP_POINT
28 # Need: COMP_CWORD COMP_WORDS
30 COMP_WORDS
=( $COMP_LINE )
31 remain
=( ${COMP_LINE:COMP_POINT} )
32 COMP_CWORD
=$
(( ${#COMP_WORDS[@]} - ${#remain[@]} ))
34 ch
="${COMP_LINE:COMP_POINT-1:1}"
35 [ -z "${ch//[ ]/}" ] ||
(( COMP_CWORD
= COMP_CWORD
- 1 ))
38 .
$HOME/.bashcomp.cache
40 "$@" # run the completion function
41 for x
in "${COMPREPLY[@]}"; do echo "$x"; done