Codebase list debian-goodies / eb5506b
Rename debmany/debmany.bash_completion for easier use of dh_install Axel Beckert 10 years ago
5 changed file(s) with 67 addition(s) and 68 deletion(s). Raw diff Collapse all Expand all
1111 (Closes: #658846)
1212 - No more swallows all exceptions (Closes: #654458)
1313 - Correctly handle alternative dependencies (Closes: #516904)
14 * [debmany]
15 - Install bash completion file to /etc/bash_completion.d instead of
16 as example.
14 * [bash_completion]
15 - Install debmany bash completion file to /etc/bash_completion.d
16 instead of as example. Rename it for easier use of dh_install.
1717 * Thanks Jakub Wilk for many bugfix patches!
1818
1919 --
0 debmany/bash_completion/debmany etc/bash_completion.d
3232 # Add here commands to install the package into debian/debian-goodies.
3333 install -d $(CURDIR)/debian/debian-goodies/usr/bin
3434 install -d $(CURDIR)/debian/debian-goodies/usr/sbin
35 install -d $(CURDIR)/debian/debian-goodies/etc/bash_completion.d
3635 install -m 755 dgrep dglob debget dpigs debman popbugs which-pkg-broke \
3736 dhomepage $(CURDIR)/debian/debian-goodies/usr/bin
3837 install -m 755 checkrestart \
4241 done
4342 install -m 755 debmany/debmany \
4443 $(CURDIR)/debian/debian-goodies/usr/bin
45 install -m 644 debmany/debmany.bash_completion \
46 $(CURDIR)/debian/debian-goodies/etc/bash_completion.d/debmany
4744
4845 # Build architecture-dependent files here.
4946 # We have nothing to do by default.
5956 debmany/man/debmany.1 debmany/man/debmany.de.1
6057 # dh_undocumented
6158 dh_installchangelogs
59 dh_install
6260 dh_link
6361 dh_compress
6462 ln -s dgrep.1.gz debian/debian-goodies/usr/share/man/man1/degrep.1.gz
0 # debmany(1) completion
1 #
2 # Copy this file to ~/.bash_completion.
3 # To activate bash completion for new logins configure ~/.bashrc
4 # or simply source /etc/bash_completion to test it.
5 # After a new login completion is done for
6 # all parameters,
7 # packages or filenames and folders.
8 #
9 have debmany &&
10 _debmany()
11 {
12 local cur prev setf
13
14 COMPREPLY=()
15 cur=${COMP_WORDS[COMP_CWORD]}
16 prev=${COMP_WORDS[COMP_CWORD-1]}
17
18 case "$prev" in
19 -L) if echo "$cur" | grep -q ^"[0-9][0-9]*[KMGT]*"; then
20 COMPREPLY=( $( compgen -W '`echo ${cur/[KMGT]/}{K,M,G,T}`' -- "$cur" ) )
21 else
22 COMPREPLY=("100K" "50M" "5G" "1T")
23 fi
24 ;;
25 -l) # show all possible languages from /usr/share/i18n/SUPPORTED
26 setf=`echo $-` # remember switch f (shell filename completion)
27 set -f
28 COMPREPLY=( $( compgen -W '`sed -e "s/[@_. ].*//g" -e "s/$/*/" /usr/share/i18n/SUPPORTED|sort -u`' -- "$cur" ) )
29 echo "$setf"|grep -q f || set +f # switch back if needed
30 ;;
31 -m) case "${cur:0:1}" in
32 \"|\') local manpageviewer="${cur:1}";;
33 *) local manpageviewer="$cur";;
34 esac
35 COMP_WORDS=(COMP_WORDS[0] "$manpageviewer")
36 COMP_CWORD=1
37 _command
38 ;;
39 -o) case "${cur:0:1}" in
40 \"|\') local otherviewer="${cur:1}";;
41 *) local otherviewer="$cur";;
42 esac
43 COMP_WORDS=(COMP_WORDS[0] "$otherviewer")
44 COMP_CWORD=1
45 _command
46 ;;
47 *) if [[ "$cur" == -* ]]; then
48 COMPREPLY=( $( compgen -W '-? -h --help -k -g -x -m -o -L -l -v -vv -z' -- "$cur" ) )
49 else
50 COMPREPLY=( $( apt-cache pkgnames "$cur" 2> /dev/null; ) )
51 if [ ${#COMPREPLY[@]} -eq 0 ]
52 then
53 _filedir
54 fi
55 fi
56 ;;
57 esac
58
59 return 0
60 } &&
61 complete -F _debmany $filenames debmany
+0
-62
debmany/debmany.bash_completion less more
0 # debmany(1) completion
1 #
2 # Copy this file to ~/.bash_completion.
3 # To activate bash completion for new logins configure ~/.bashrc
4 # or simply source /etc/bash_completion to test it.
5 # After a new login completion is done for
6 # all parameters,
7 # packages or filenames and folders.
8 #
9 have debmany &&
10 _debmany()
11 {
12 local cur prev setf
13
14 COMPREPLY=()
15 cur=${COMP_WORDS[COMP_CWORD]}
16 prev=${COMP_WORDS[COMP_CWORD-1]}
17
18 case "$prev" in
19 -L) if echo "$cur" | grep -q ^"[0-9][0-9]*[KMGT]*"; then
20 COMPREPLY=( $( compgen -W '`echo ${cur/[KMGT]/}{K,M,G,T}`' -- "$cur" ) )
21 else
22 COMPREPLY=("100K" "50M" "5G" "1T")
23 fi
24 ;;
25 -l) # show all possible languages from /usr/share/i18n/SUPPORTED
26 setf=`echo $-` # remember switch f (shell filename completion)
27 set -f
28 COMPREPLY=( $( compgen -W '`sed -e "s/[@_. ].*//g" -e "s/$/*/" /usr/share/i18n/SUPPORTED|sort -u`' -- "$cur" ) )
29 echo "$setf"|grep -q f || set +f # switch back if needed
30 ;;
31 -m) case "${cur:0:1}" in
32 \"|\') local manpageviewer="${cur:1}";;
33 *) local manpageviewer="$cur";;
34 esac
35 COMP_WORDS=(COMP_WORDS[0] "$manpageviewer")
36 COMP_CWORD=1
37 _command
38 ;;
39 -o) case "${cur:0:1}" in
40 \"|\') local otherviewer="${cur:1}";;
41 *) local otherviewer="$cur";;
42 esac
43 COMP_WORDS=(COMP_WORDS[0] "$otherviewer")
44 COMP_CWORD=1
45 _command
46 ;;
47 *) if [[ "$cur" == -* ]]; then
48 COMPREPLY=( $( compgen -W '-? -h --help -k -g -x -m -o -L -l -v -vv -z' -- "$cur" ) )
49 else
50 COMPREPLY=( $( apt-cache pkgnames "$cur" 2> /dev/null; ) )
51 if [ ${#COMPREPLY[@]} -eq 0 ]
52 then
53 _filedir
54 fi
55 fi
56 ;;
57 esac
58
59 return 0
60 } &&
61 complete -F _debmany $filenames debmany