1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/bashcompletion/rock-tools
3 # Copyright (C) 2004 - 2022 The T2 SDE Project
4 # Copyright (C) 1998 - 2004 ROCK Linux Project
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2.
11 # --- T2-COPYRIGHT-NOTE-END ---
14 COMPREPLY=( $( compgen -W "$( command \
15 sed -ne 's|^interface \([^ ]\+\).*$|\1|p' \
16 /etc/network/config )" -- $cur ) )
19 _mine_installed_packages() {
20 COMPREPLY=( $( compgen -W "`(cd /var/adm/packages; echo *)`" -- $cur ) )
27 cur=${COMP_WORDS[COMP_CWORD]}
28 prev=${COMP_WORDS[COMP_CWORD-1]}
30 if [ $COMP_CWORD -eq 1 ]; then
33 COMPREPLY=( $( compgen -W '-i -r -q -p -l -m -c -d -k -C -T' \
47 COMPREPLY=( $( compgen -W 'pkg_name pkg_version pkg_tarbz2 \
48 pkg_config packages flists md5sums cksums \
49 dependencies descs creator COPY I TITLE T \
50 TEXT U URL A AUTHOR M MAINTAINER C CATEGORY \
51 F FLAG R ARCH ARCHITECTURE E DEP DEPENDENCY \
52 L LICENSE S STATUS V VER VERSION P PRI \
53 PRIORITY CV-URL CV-PAT CV-DEL O CONF D DOWN \
54 DOWNLOAD SRC SOURCEPACKAGE' -- $cur ) )
58 case "${COMP_WORDS[1]}" in
60 if [[ "$cur" == -* ]]; then
61 COMPREPLY=( $( compgen -W '-t -v -f -R' -- $cur ) )
67 if [[ "$cur" == -* ]]; then
68 COMPREPLY=( $( compgen -W '-t -v -f -R' -- $cur ) )
70 _mine_installed_packages
74 if [[ "$cur" == -* ]]; then
75 COMPREPLY=( $( compgen -W '-h -H' -- $cur ) )
77 _mine_installed_packages
82 if [[ "$cur" == -* ]]; then
83 COMPREPLY=( $( compgen -W '-h -H' -- $cur ) )
97 _mine_installed_packages
102 case "$COMP_CWORD" in
107 _mine_installed_packages
114 complete -F _mine $filenames mine
119 cur=${COMP_WORDS[COMP_CWORD]}
120 prev=${COMP_WORDS[COMP_CWORD-1]}
122 if [ $COMP_CWORD -eq 1 ]; then
123 #first parameter on line
124 if [ -r /etc/rc.d/init.d ]; then
125 COMPREPLY=( $( compgen -W "`(cd /etc/rc.d/init.d; echo *)`" \
131 if [ $COMP_CWORD -eq 2 ]; then
132 #second parameter on line
133 COMPREPLY=( $( compgen -W "$( command rc $prev help | \
134 cut -d{ -f2 | tr -d '{}|' )" \
139 complete -F _rc $filenames rc