summaryrefslogtreecommitdiff
path: root/shells/bash-completion/patches/patch-aa
blob: 42c6fc29d6f1a5ccbe2e4e4ef563d3058b7873a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
$NetBSD: patch-aa,v 1.1 2009/09/25 12:29:27 wiz Exp $

--- bash_completion.orig	2009-04-02 20:01:39.000000000 +0000
+++ bash_completion
@@ -724,6 +724,11 @@ complete -F _complete complete
 	extract patch configure build install reinstall \
 	deinstall clean clean-depends kernel buildworld' make
 
+# a little help for NetBSD pkgsrc users
+[ $UNAME = NetBSD ] && complete -W 'index search fetch fetch-list \
+	extract patch configure build install reinstall \
+	deinstall package clean clean-depends' make
+
 # This completes on a list of all available service scripts for the
 # 'service' command and/or the SysV init.d directory, followed by
 # that script's available commands
@@ -941,7 +946,7 @@ complete -F _insmod $filenames insmod mo
 #
 [ $UNAME = GNU -o $UNAME = Linux -o $UNAME = Darwin \
   -o $UNAME = FreeBSD -o $UNAME = SunOS -o $UNAME = Cygwin \
-  -o $UNAME = OpenBSD ] &&
+  -o $UNAME = OpenBSD -o $UNAME = NetBSD ] &&
 _man()
 {
 	local cur prev sect manpath manext mansect UNAME
@@ -1013,7 +1018,7 @@ _man()
 }
 [ $UNAME = GNU -o $UNAME = Linux -o $UNAME = Darwin \
   -o $UNAME = FreeBSD -o $UNAME = SunOS -o $UNAME = Cygwin \
-  -o $UNAME = OpenBSD ] && \
+  -o $UNAME = OpenBSD -o $UNAME = NetBSD ] && \
 complete -F _man $filenames man apropos whatis
 
 # renice(8) completion
@@ -5627,6 +5632,28 @@ _links()
 } &&
 complete -F _links $filenames links
 
+[ $UNAME = NetBSD ] && {
+# NetBSD package management tool completion
+#
+_pkg_delete()
+{
+	local cur pkgdir prev
+
+	pkgdir=${PKG_DBDIR:-/var/db/pkg}/
+	cur=`_get_cword`
+	prev=${COMP_WORDS[COMP_CWORD-1]}
+
+	[ "$prev" = "-o" -o "$prev" = "-p" -o "$prev" = "-W" ] && return 0
+
+	COMPREPLY=( $( compgen -d $pkgdir$cur ) )
+	COMPREPLY=( ${COMPREPLY[@]#$pkgdir} )
+
+	return 0
+}
+complete -F _pkg_delete $dirnames pkg_delete pkg_info
+have pkg_deinstall && complete -F _pkg_delete $dirnames pkg_deinstall
+}
+
 [ $UNAME = FreeBSD ] && {
 # FreeBSD package management tool completion
 #