/[gentoo-x86]/www-apps/nanoblogger/files/nb.bashcomp
Gentoo

Contents of /www-apps/nanoblogger/files/nb.bashcomp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon Jan 31 10:19:45 2005 UTC (5 years, 7 months ago) by ka0ttic
Branch: MAIN
CVS Tags: HEAD
Revision bump; added bash-completion.
(Portage version: 2.0.51-r15)
1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-apps/nanoblogger/files/nb.bashcomp,v 1.1 2005/01/31 10:19:45 ka0ttic Exp $
4
5 # nanoblogger completion
6 # author: Aaron Walker <ka0ttic@gentoo.org>
7
8 _nb()
9 {
10 local cur prev opts
11 COMPREPLY=()
12 cur="${COMP_WORDS[COMP_CWORD]}"
13 prev="${COMP_WORDS[COMP_CWORD-1]}"
14 opts="-a --add -b --blogdir -B --body -c --category --configure \
15 --datadir -d --delete -D --desc -e --edit -f --blogconf -h --help \
16 -l --list --makepage --manual -m --move -n --author -p --preview \
17 -P --publish --template --templatedir -t --title -u --update \
18 -v --verbose -V --version"
19
20 if [[ "${cur}" == -* || ${COMP_CWORD} -eq 1 ]] ; then
21 COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
22 return 0
23 fi
24
25 case "${prev}" in
26 -b|--*dir)
27 COMPREPLY=($(compgen -d -S '/' -- ${cur}))
28 ;;
29 -f|--blogconf|--template)
30 COMPREPLY=($(compgen -f -- ${cur}))
31 ;;
32 -l|--list)
33 COMPREPLY=($(compgen -W "all cat current max" -- ${cur}))
34 ;;
35 -u|--update)
36 COMPREPLY=($(compgen -W "all current main max" -- ${cur}))
37 ;;
38 ?(-)-@(B|body|c|category|d|delete|D|desc|m|move|n|author|t|title))
39 COMPREPLY=()
40 ;;
41 *)
42 COMPREPLY=($(compgen -W "${opts/${prev}}" -- ${cur}))
43 ;;
44 esac
45 }
46 complete -F _nb nb
47
48 # vim: set ft=sh :

  ViewVC Help
Powered by ViewVC 1.1.6