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

« back to all changes in this revision

Viewing changes to completions/sitecopy

  • 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
 
# sitecopy(1) completion
 
1
# sitecopy(1) completion                                   -*- shell-script -*-
2
2
# Copyright 2003 Eelco Lempsink <eelcolempsink@gmx.net>
 
3
#           2011 Raphaël Droz <raphael.droz+floss@gmail.com>
3
4
# License: GNU GPL v2 or later
4
5
 
5
 
have sitecopy &&
6
6
_sitecopy()
7
7
{
8
 
    local cur
 
8
    local cur prev words cword split
 
9
    _init_completion -s || return
9
10
 
10
 
    COMPREPLY=()
11
 
    _get_comp_words_by_ref cur
 
11
    case $prev in
 
12
        --debug|-d)
 
13
            COMPREPLY=( $( compgen -W "socket files rcfile ftp http httpbody
 
14
                rsh sftp xml xmlparse cleartext" -- "$cur" ) )
 
15
            compopt -o nospace
 
16
            return 0
 
17
            ;;
 
18
        --logfile|-g|--rcfile|-r)
 
19
            _filedir
 
20
            return 0
 
21
            ;;
 
22
        --storepath|-p)
 
23
            _filedir -d
 
24
            return 0
 
25
            ;;
 
26
    esac
12
27
 
13
28
    case $cur in
14
29
        --*)
15
 
            COMPREPLY=( $( compgen -W "$(sitecopy -h | command grep -e '--\w' |\
16
 
                awk '{sub (/=(FILE|PATH)/, "", $2); print $2}')" -- "$cur" ) )
17
 
            ;;
18
 
        -*)
19
 
            COMPREPLY=( $( compgen -W "$(sitecopy -h | command grep -e '-\w' | \
20
 
                awk '{sub (",", "", $1); print $1}')" -- "$cur" ) )
21
 
            ;;
22
 
        *)
23
 
            if [ -r ~/.sitecopyrc ]; then
24
 
                COMPREPLY=( $( compgen -W "$(command grep '^["$'\t '"]*site' \
25
 
                    ~/.sitecopyrc | awk '{print $2}')" -- "$cur" ) )
26
 
            fi
 
30
            COMPREPLY=( $( compgen -W "$(_parse_help $1)" -- "$cur" ) )
 
31
            [[ $COMPREPLY == *= ]] && compopt -o nospace
 
32
            return 0
 
33
            ;;
 
34
 
 
35
        # only complete long options
 
36
        -)
 
37
            compopt -o nospace
 
38
            COMPREPLY=( -- )
 
39
            return 0
27
40
            ;;
28
41
    esac
29
42
 
 
43
    if [[ -r ~/.sitecopyrc ]]; then
 
44
        COMPREPLY=( $( compgen -W "$($1 -v | \
 
45
                        command sed -n '/^Site:/s/Site: //p')" -- "$cur" ) )
 
46
    fi
30
47
    return 0
31
48
} &&
32
49
complete -F _sitecopy -o default sitecopy
33
50
 
34
 
# Local variables:
35
 
# mode: shell-script
36
 
# sh-basic-offset: 4
37
 
# sh-indent-comment: t
38
 
# indent-tabs-mode: nil
39
 
# End:
40
51
# ex: ts=4 sw=4 et filetype=sh