~ubuntu-branches/ubuntu/vivid/bash-completion/vivid-proposed

« back to all changes in this revision

Viewing changes to completions/bzip2

  • Committer: Package Import Robot
  • Author(s): David Paleino
  • Date: 2011-02-06 22:00:58 UTC
  • mfrom: (1.1.4)
  • mto: (5.1.9 sid)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20110206220058-zfh1gyor3vp1goqc
Tags: 1:1.3-1
* New upstream release
  - Fixed "service" completion, thanks to John Hedges (Closes: #586210)
  - Fixed typo in openssl completion (Closes: #609552)
  - Added ip completion (Closes: #600617)
  - Added _tilde(), fix ~username completion (Closes: #587095)
  - Add *.webm to mplayer file completions (Closes: #588079).
* debian/watch: fix to handle .tar.bz2 files
* Bump Standards-Version to 3.9.1, no changes needed
* Install upstream CHANGES file
* Update copyright years in debian/copyright
* debian/rules: reflect new source layout

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# bash completion for bzip2
 
2
 
 
3
have bzip2 || have pbzip2 &&
 
4
_bzip2()
 
5
{
 
6
    local cur prev xspec helpopts
 
7
 
 
8
    COMPREPLY=()
 
9
    _get_comp_words_by_ref cur prev
 
10
    helpopts=`_parse_help ${COMP_WORDS[0]}`
 
11
 
 
12
    case $prev in
 
13
        -b|-h|--help|-p)
 
14
            return 0
 
15
            ;;
 
16
    esac
 
17
 
 
18
    if [[ "$cur" == -* ]]; then
 
19
        COMPREPLY=( $( compgen -W "${helpopts//#/} -2 -3 -4 -5 -6 -7 -8 -9" \
 
20
            -- "$cur" ) )
 
21
        return 0
 
22
    fi
 
23
 
 
24
    local IFS=$'\n'
 
25
 
 
26
    xspec="*.bz2"
 
27
    if [[ "$prev" == --* ]]; then
 
28
        [[ "$prev" == --decompress || \
 
29
            "$prev" == --list || \
 
30
            "$prev" == --test ]] && xspec="!"$xspec
 
31
        [[ "$prev" == --compress ]] && xspec=
 
32
    elif [[ "$prev" == -* ]]; then
 
33
        [[ "$prev" == -*[dt]* ]] && xspec="!"$xspec
 
34
        [[ "$prev" == -*z* ]] && xspec=
 
35
    fi
 
36
 
 
37
    _expand || return 0
 
38
 
 
39
    _compopt_o_filenames
 
40
    COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
 
41
        $( compgen -d -- "$cur" ) )
 
42
} &&
 
43
complete -F _bzip2 bzip2 pbzip2
 
44
 
 
45
# Local variables:
 
46
# mode: shell-script
 
47
# sh-basic-offset: 4
 
48
# sh-indent-comment: t
 
49
# indent-tabs-mode: nil
 
50
# End:
 
51
# ex: ts=4 sw=4 et filetype=sh