~ubuntu-branches/ubuntu/trusty/bash-completion/trusty-updates

« back to all changes in this revision

Viewing changes to completions/_mock

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2012-07-23 16:07:59 UTC
  • mfrom: (5.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120723160759-lt9vn33dl3nak9l0
Tags: 1:2.0-1ubuntu1
* debian/maintscript, debian/postinst:
  - clean etc conffiles on upgrade since completion files are in /usr
    with the new version
* Resync with Debian, remaining diff
  * debian/patches/disable-avahi-browse.diff: Disable avahi-browse since
    it scales poorly in the current form: refresh patch
  * patches/101_bash_completion.oga_ogv.patch: Increase support for other
    OGG formats including .oga, .ogx, etc. (LP: #311525)
  * patches/103_colormake.patch: Add support for colormake to the make
    completion rules. (LP: #743208)
* Dropped changes:
  * Add conffile upgrade handling for a run of conffiles that were dropped
    since lucid: lucid upgrades are only supported to precise.
* Those fixes are in the new version
  * debian/patches/apt-get-changelog.patch:
  * Drop whitelists if they fail to produce any results:
  * patches/apt-get-download.patch: Add download as an apt-get
    sub-command (LP: #720541)
  * patches/102_manpager.patch: Override MANPAGER when generating perldoc
    completions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# bash completion for mock                                 -*- shell-script -*-
 
2
 
1
3
# Use of this file is deprecated.  Upstream completion is available in
2
4
# mock > 1.1.0, use that instead.
3
5
 
4
 
# bash completion for mock
5
 
 
6
 
have mock &&
7
6
_mock()
8
7
{
9
 
    local cur prev plugins cfgdir split=false
10
 
 
11
 
    COMPREPLY=()
12
 
    _get_comp_words_by_ref cur prev
13
 
    plugins='tmpfs root_cache yum_cache bind_mount ccache'
14
 
    cfgdir=/etc/mock
15
 
 
16
 
    count=0
17
 
    for i in "${COMP_WORDS[@]}" ; do
18
 
        [ $count -eq $COMP_CWORD ] && break
 
8
    local cur prev words cword split
 
9
    _init_completion -s || return
 
10
 
 
11
    local plugins='tmpfs root_cache yum_cache bind_mount ccache'
 
12
    local cfgdir=/etc/mock count=0 i
 
13
 
 
14
    for i in "${words[@]}" ; do
 
15
        [[ $count -eq $cword ]] && break
19
16
        if [[ "$i" == --configdir ]] ; then
20
 
            cfgdir="${COMP_WORDS[((count+1))]}"
 
17
            cfgdir="${words[((count+1))]}"
21
18
        elif [[ "$i" == --configdir=* ]] ; then
22
19
            cfgdir=${i/*=/}
23
20
        fi
24
21
        count=$((++count))
25
22
    done
26
23
 
27
 
    _split_longopt && split=true
28
 
 
29
24
    case $prev in
30
25
        -h|--help|--copyin|--copyout|--arch|-D|--define|--with|--without|\
31
26
        --uniqueext|--rpmbuild_timeout|--sources|--cwd)
63
58
    $split && return 0
64
59
 
65
60
    if [[ "$cur" == -* ]] ; then
66
 
        COMPREPLY=( $( compgen -W '--version --help --rebuild --buildsrpm
67
 
            --shell --chroot --clean --init --installdeps --install --update
68
 
            --orphanskill --copyin --copyout --root --offline --no-clean
69
 
            --cleanup-after --no-cleanup-after --arch --target --define --with
70
 
            --without --resultdir --uniqueext --configdir --rpmbuild_timeout
71
 
            --unpriv --cwd --spec --sources --verbose --quiet --trace
72
 
            --enable-plugin --disable-plugin --print-root-path' -- "$cur" ) )
 
61
        COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
 
62
        [[ $COMPREPLY == *= ]] && compopt -o nospace
73
63
    else
74
64
        _filedir '@(?(no)src.r|s)pm'
75
65
    fi
76
66
} &&
77
67
complete -F _mock mock
78
68
 
79
 
# Local variables:
80
 
# mode: shell-script
81
 
# sh-basic-offset: 4
82
 
# sh-indent-comment: t
83
 
# indent-tabs-mode: nil
84
 
# End:
85
69
# ex: ts=4 sw=4 et filetype=sh