~ubuntu-branches/debian/experimental/bash-completion/experimental

« back to all changes in this revision

Viewing changes to completions/bzip2

  • Committer: Package Import Robot
  • Author(s): David Paleino
  • Date: 2011-11-03 13:03:51 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20111103130351-mjans3w2ufbwwssf
Tags: 1:1.90-1
* bash-completion 2 preview: dynamic loading of completions
  - optionally fallback to generic file completion if _filedir
    returns nothing (Closes: #619014, LP: #533985)
  - various fixes (Closes: #622383)
  - apt: add 'download' to subcommands (Closes: #625234, LP: #720541)
  - aptitude: add 'versions' command (Closes: #604393)
  - dpkg-query: use the 'dpkg' completion (Closes: #642526)
  - lintian: remove --unpack-level (Closes: #623680)
  - rrdtool: complete filenames after commands (Closes: #577933)
  - provide profile.d hook for per user disabling of bash_completion
    (Closes: #593835)
  - mutt: support tildes when recursively sourcing muttrc files
    (Closes: #615134)
  - tar: improve tar *[cr]*f completions (Closes: #618734)
* More checks in update-bash-completion: avoid unnecessary
  sourcing of completion if symlink already exists
* Add message for users before they report a bug (debian/bug-presubj),
  I'm kind of fed-up with bugs caused by acroread.sh :/
* Removed patches merged upstream
* Drop trigger-based completion loading
* Standards-Version bump to 3.9.2, no changes needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# bash completion for bzip2
 
1
# bash completion for bzip2                                -*- shell-script -*-
2
2
 
3
 
have bzip2 || have pbzip2 &&
4
3
_bzip2()
5
4
{
6
 
    local cur prev xspec helpopts
7
 
 
8
 
    COMPREPLY=()
9
 
    _get_comp_words_by_ref cur prev
10
 
    helpopts=`_parse_help ${COMP_WORDS[0]}`
 
5
    local cur prev words cword
 
6
    _init_completion || return
11
7
 
12
8
    case $prev in
13
9
        -b|-h|--help|-p)
16
12
    esac
17
13
 
18
14
    if [[ "$cur" == -* ]]; then
 
15
        local helpopts=$( _parse_help "$1" )
19
16
        COMPREPLY=( $( compgen -W "${helpopts//#/} -2 -3 -4 -5 -6 -7 -8 -9" \
20
17
            -- "$cur" ) )
21
18
        return 0
22
19
    fi
23
20
 
24
 
    local IFS=$'\n'
 
21
    local IFS=$'\n' xspec="*.bz2"
25
22
 
26
 
    xspec="*.bz2"
27
23
    if [[ "$prev" == --* ]]; then
28
24
        [[ "$prev" == --decompress || \
29
25
            "$prev" == --list || \
36
32
 
37
33
    _expand || return 0
38
34
 
39
 
    _compopt_o_filenames
 
35
    compopt -o filenames
40
36
    COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
41
37
        $( compgen -d -- "$cur" ) )
42
38
} &&
43
 
complete -F _bzip2 bzip2 pbzip2
 
39
complete -F _bzip2 bzip2 pbzip2 lbzip2
44
40
 
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
41
# ex: ts=4 sw=4 et filetype=sh