Added bash-completion.
authorAaron Walker <ka0ttic@gentoo.org>
Tue, 30 Aug 2005 14:15:49 +0000 (14:15 +0000)
committerAaron Walker <ka0ttic@gentoo.org>
Tue, 30 Aug 2005 14:15:49 +0000 (14:15 +0000)
Package-Manager: portage-2.0.51.22-r2

app-text/tree/ChangeLog
app-text/tree/Manifest
app-text/tree/files/tree.bashcomp [new file with mode: 0644]
app-text/tree/tree-1.5.0.ebuild

index e1b1928b50300dbafd25f0042372bfda5a4124f9..4b442a4d84c1e933ba5aa7d7b0c02ab2b1b97456 100644 (file)
@@ -1,6 +1,10 @@
 # ChangeLog for app-text/tree
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/tree/ChangeLog,v 1.30 2005/08/09 18:36:59 ka0ttic Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-text/tree/ChangeLog,v 1.31 2005/08/30 14:15:49 ka0ttic Exp $
+
+  30 Aug 2005; Aaron Walker <ka0ttic@gentoo.org> +files/tree.bashcomp,
+  tree-1.5.0.ebuild:
+  Added bash-completion.
 
   09 Aug 2005; Aaron Walker <ka0ttic@gentoo.org> tree-1.5.0.ebuild:
   Stable on mips.
index 7685edd94b0013230ec789412f70b4108d11ae06..9204bd8ed8286bbd61bf2f85a9b8ba88e4d13d83 100644 (file)
@@ -1,14 +1,15 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-MD5 16cd71a883f169312e4c2823ec8b86c5 ChangeLog 3042
+MD5 e9ec901be880124d07f77a73707b0c1c tree-1.5.0.ebuild 785
+MD5 fd733e18bf9312abdb65a24512c144d3 ChangeLog 3160
 MD5 27c80a8d690d932f131215d791821fcd metadata.xml 253
-MD5 8300eb5ae0f977a7162977218443635e tree-1.5.0.ebuild 724
 MD5 a28602d0f51c1e2a383cc6ff64fdbcbf files/digest-tree-1.5.0 58
+MD5 3cbb0e1e6d1d87c0151a750998e1adb3 files/tree.bashcomp 1023
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.1 (GNU/Linux)
+Version: GnuPG v1.4.2 (GNU/Linux)
 
-iD8DBQFC+PftEZCkKN40op4RAr/eAJ0SCJfSOWr7CzxeyJa2zkQc7KK3gACfYxz3
-EGC50plRmevx63x5MLGtGe0=
-=/6hr
+iD8DBQFDFGpREZCkKN40op4RAm2EAJ9r0r4vC1+OewqLqmPrzE9YtUYzWACfUvLx
+/Tio//NXKsAVLxNRTx6ZAlY=
+=KOWf
 -----END PGP SIGNATURE-----
diff --git a/app-text/tree/files/tree.bashcomp b/app-text/tree/files/tree.bashcomp
new file mode 100644 (file)
index 0000000..b5da3ee
--- /dev/null
@@ -0,0 +1,35 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/tree/files/tree.bashcomp,v 1.1 2005/08/30 14:15:49 ka0ttic Exp $
+
+# bash command-line completion for tree
+# Author: Aaron Walker <ka0ttic@gentoo.org>
+
+_tree() {
+    local cur prev opts
+    COMPREPLY=()
+    cur="${COMP_WORDS[COMP_CWORD]}"
+    prev="${COMP_WORDS[COMP_CWORD-1]}"
+    opts="-a -d -l -f -i -q -N -p -u -g -s -D -F -r -t -x -L -A
+    -S -n -C -P -I -H -T -R -o --inodes --device --noreport --nolinks
+    --dirsfirst --charset --help"
+
+    if [[ ${cur} == -* ]] ; then
+        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+        return 0
+    fi
+
+    case "${prev}" in
+        -L|-P|-I|-H|-T|--charset|--help)
+            ;;
+        -o)
+            COMPREPLY=( $(compgen -f -- ${cur}) )
+            ;;
+        *)
+            COMPREPLY=( $(compgen -d -- ${cur}) )
+            ;;
+    esac
+}
+complete -o filenames -F _tree tree
+
+# vim: set ft=sh tw=80 sw=4 et :
index 2f9636c4711723ee839e4ea27ae1c321ab2acade..6348bd9c53d3425f1c912bcb26b8991e22984da4 100644 (file)
@@ -1,8 +1,8 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/tree/tree-1.5.0.ebuild,v 1.12 2005/08/09 18:36:59 ka0ttic Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-text/tree/tree-1.5.0.ebuild,v 1.13 2005/08/30 14:15:49 ka0ttic Exp $
 
-inherit toolchain-funcs
+inherit toolchain-funcs bash-completion
 
 DESCRIPTION="Lists directories recursively, and produces an indented listing of files."
 HOMEPAGE="http://mama.indstate.edu/users/ice/tree/"
@@ -24,4 +24,5 @@ src_install() {
        dobin tree || die "dobin failed"
        doman tree.1
        dodoc CHANGES README*
+       dobashcompletion ${FILESDIR}/${PN}.bashcomp
 }