@ -0,0 +1,37 @@ |
|||||
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
# |
||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
# Please add additional copyright information _after_ the line containing |
||||
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
# |
||||
|
# ROCK Linux: rock-src/package/mathieu/bashcompletion/bashcompletion.conf |
||||
|
# ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf |
||||
|
# |
||||
|
# This program is free software; you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU General Public License as published by |
||||
|
# the Free Software Foundation; either version 2 of the License, or |
||||
|
# (at your option) any later version. A copy of the GNU General Public |
||||
|
# License can be found at Documentation/COPYING. |
||||
|
# |
||||
|
# Many people helped and are helping developing ROCK Linux. Please |
||||
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
# file for details. |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
|
||||
|
bc_main() { |
||||
|
cp bash_completion $root/etc/ |
||||
|
ln -snf ../bash_completion $root/etc/profile.d/ |
||||
|
mkdir -p $root/etc/bash_completion.d |
||||
|
|
||||
|
(cd contrib |
||||
|
for i in * |
||||
|
do |
||||
|
pkginstalled $i && cp $i $root/etc/bash_completion.d/ |
||||
|
done) |
||||
|
|
||||
|
cp $confdir/rock-tools $root/etc/bash_completion.d/ |
||||
|
} |
||||
|
|
||||
|
custmain="bc_main" |
@ -0,0 +1,49 @@ |
|||||
|
|
||||
|
[COPY] --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
[COPY] |
||||
|
[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
[COPY] Please add additional copyright information _after_ the line containing |
||||
|
[COPY] the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
[COPY] the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
[COPY] |
||||
|
[COPY] ROCK Linux: rock-src/package/mathieu/bashcompletion/bashcompletion.desc |
||||
|
[COPY] ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf |
||||
|
[COPY] |
||||
|
[COPY] This program is free software; you can redistribute it and/or modify |
||||
|
[COPY] it under the terms of the GNU General Public License as published by |
||||
|
[COPY] the Free Software Foundation; either version 2 of the License, or |
||||
|
[COPY] (at your option) any later version. A copy of the GNU General Public |
||||
|
[COPY] License can be found at Documentation/COPYING. |
||||
|
[COPY] |
||||
|
[COPY] Many people helped and are helping developing ROCK Linux. Please |
||||
|
[COPY] have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
[COPY] file for details. |
||||
|
[COPY] |
||||
|
[COPY] --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
|
||||
|
[I] Programmable completion for bash. |
||||
|
|
||||
|
[T] Since v2.04, bash has allowed you to intelligently program and extend its |
||||
|
[T] standard completion behavior to achieve complex command lines with just a |
||||
|
[T] few keystrokes. Imagine typing ssh [Tab] and being able to complete on |
||||
|
[T] hosts from your ~/.ssh/known_hosts files. Or typing man 3 str [Tab] and |
||||
|
[T] getting a list of all string handling functions in the UNIX manual. |
||||
|
[T] mount system: [Tab] would complete on all exported file-systems from the |
||||
|
[T] host called system, while make [Tab] would complete on all targets in |
||||
|
[T] Makefile. This project was conceived to produce programmable completion |
||||
|
[T] routines for the most common Linux/UNIX commands, reducing the amount of |
||||
|
[T] typing sysadmins and programmers need to do on a daily basis. |
||||
|
|
||||
|
[U] http://www.caliban.org/bash/index.shtml#completion |
||||
|
|
||||
|
[A] Ian Macdonald <ian@caliban.org> |
||||
|
[M] Mathieu Doidy <mdoidy@roulaize.net> |
||||
|
|
||||
|
[C] extra/base |
||||
|
|
||||
|
[L] GPL |
||||
|
[S] Stable |
||||
|
[V] 20040331 |
||||
|
[P] X -----5---9 800.000 |
||||
|
|
||||
|
[D] 160358708 bash-completion-20040331.tar.bz2 http://www.caliban.org/files/bash/ |
@ -0,0 +1,150 @@ |
|||||
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
# |
||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
# Please add additional copyright information _after_ the line containing |
||||
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
# |
||||
|
# ROCK Linux: rock-src/package/mathieu/bashcompletion/rock-tools |
||||
|
# ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf |
||||
|
# |
||||
|
# This program is free software; you can redistribute it and/or modify |
||||
|
# it under the terms of the GNU General Public License as published by |
||||
|
# the Free Software Foundation; either version 2 of the License, or |
||||
|
# (at your option) any later version. A copy of the GNU General Public |
||||
|
# License can be found at Documentation/COPYING. |
||||
|
# |
||||
|
# Many people helped and are helping developing ROCK Linux. Please |
||||
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
# file for details. |
||||
|
# |
||||
|
# --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
|
||||
|
_interfaces() { |
||||
|
COMPREPLY=( $( compgen -W "$( command \ |
||||
|
sed -ne 's|^interface \([^ ]\+\).*$|\1|p' \ |
||||
|
/etc/network/config )" -- $cur ) ) |
||||
|
} |
||||
|
|
||||
|
_mine_installed_packages() { |
||||
|
COMPREPLY=( $( compgen -W "`(cd /var/adm/packages; echo *)`" -- $cur ) ) |
||||
|
} |
||||
|
|
||||
|
_mine() { |
||||
|
local cur prev |
||||
|
|
||||
|
COMPREPLY=() |
||||
|
cur=${COMP_WORDS[COMP_CWORD]} |
||||
|
prev=${COMP_WORDS[COMP_CWORD-1]} |
||||
|
|
||||
|
if [ $COMP_CWORD -eq 1 ]; then |
||||
|
case "$cur" in |
||||
|
*) |
||||
|
COMPREPLY=( $( compgen -W '-i -r -q -p -l -m -c -d -k -C -T' \ |
||||
|
-- $cur ) ) |
||||
|
;; |
||||
|
esac |
||||
|
|
||||
|
return 0 |
||||
|
fi |
||||
|
|
||||
|
case "$prev" in |
||||
|
-R) |
||||
|
_filedir -d |
||||
|
return 0 |
||||
|
;; |
||||
|
-k) |
||||
|
COMPREPLY=( $( compgen -W 'pkg_name pkg_version pkg_tarbz2 \ |
||||
|
pkg_config packages flists md5sums cksums \ |
||||
|
dependencies descs creator COPY I TITLE T \ |
||||
|
TEXT U URL A AUTHOR M MAINTAINER C CATEGORY \ |
||||
|
F FLAG R ARCH ARCHITECTURE E DEP DEPENDENCY \ |
||||
|
L LICENSE S STATUS V VER VERSION P PRI \ |
||||
|
PRIORITY CV-URL CV-PAT CV-DEL O CONF D DOWN \ |
||||
|
DOWNLOAD SRC SOURCEPACKAGE' -- $cur ) ) |
||||
|
return 0 |
||||
|
esac |
||||
|
|
||||
|
case "${COMP_WORDS[1]}" in |
||||
|
-i) |
||||
|
if [[ "$cur" == -* ]]; then |
||||
|
COMPREPLY=( $( compgen -W '-t -v -f -R' -- $cur ) ) |
||||
|
else |
||||
|
_filedir 'gem' |
||||
|
fi |
||||
|
;; |
||||
|
-r) |
||||
|
if [[ "$cur" == -* ]]; then |
||||
|
COMPREPLY=( $( compgen -W '-t -v -f -R' -- $cur ) ) |
||||
|
else |
||||
|
_mine_installed_packages |
||||
|
fi |
||||
|
;; |
||||
|
-[qplmcd]) |
||||
|
if [[ "$cur" == -* ]]; then |
||||
|
COMPREPLY=( $( compgen -W '-h -H' -- $cur ) ) |
||||
|
else |
||||
|
_mine_installed_packages |
||||
|
_filedir 'gem' |
||||
|
fi |
||||
|
;; |
||||
|
-k) |
||||
|
if [[ "$cur" == -* ]]; then |
||||
|
COMPREPLY=( $( compgen -W '-h -H' -- $cur ) ) |
||||
|
else |
||||
|
_filedir 'gem' |
||||
|
fi |
||||
|
;; |
||||
|
-C) |
||||
|
case "$COMP_CWORD" in |
||||
|
2) |
||||
|
_filedir -d |
||||
|
;; |
||||
|
3) |
||||
|
_filedir 'tar.bz2' |
||||
|
;; |
||||
|
4) |
||||
|
_mine_installed_packages |
||||
|
;; |
||||
|
esac |
||||
|
;; |
||||
|
-T) |
||||
|
case "$COMP_CWORD" in |
||||
|
2|3) |
||||
|
_filedir -d |
||||
|
;; |
||||
|
4) |
||||
|
_mine_installed_packages |
||||
|
;; |
||||
|
esac |
||||
|
esac |
||||
|
|
||||
|
return 0 |
||||
|
} |
||||
|
complete -F _mine $filenames mine |
||||
|
|
||||
|
_rc() |
||||
|
{ |
||||
|
COMPREPLY=() |
||||
|
cur=${COMP_WORDS[COMP_CWORD]} |
||||
|
prev=${COMP_WORDS[COMP_CWORD-1]} |
||||
|
|
||||
|
if [ $COMP_CWORD -eq 1 ]; then |
||||
|
#first parameter on line |
||||
|
if [ -r /etc/rc.d/init.d ]; then |
||||
|
COMPREPLY=( $( compgen -W "`(cd /etc/rc.d/init.d; echo *)`" \ |
||||
|
-- $cur ) ) |
||||
|
fi |
||||
|
return 0 |
||||
|
fi |
||||
|
|
||||
|
if [ $COMP_CWORD -eq 2 ]; then |
||||
|
#second parameter on line |
||||
|
COMPREPLY=( $( compgen -W "$( command rc $prev help | \ |
||||
|
cut -d{ -f2 | tr -d '{}|' )" \ |
||||
|
-- $cur ) ) |
||||
|
return 0 |
||||
|
fi |
||||
|
} |
||||
|
complete -F _rc $filenames rc |
||||
|
|