~jjo/bash-completion/quote_readline_by_ref_fixes

« back to all changes in this revision

Viewing changes to completions/mcrypt

  • 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
 
# mcrypt(1) completion by Ariel Fermani <the_end@bbs.frc.utn.edu.ar>
 
1
# mcrypt(1) completion                                     -*- shell-script -*-
 
2
# by Ariel Fermani <the_end@bbs.frc.utn.edu.ar>
2
3
 
3
 
have mcrypt || have mdecrypt &&
4
4
_mcrypt()
5
5
{
6
 
    local cur prev i decrypt
7
 
 
8
 
    COMPREPLY=()
9
 
    _get_comp_words_by_ref cur prev
 
6
    local cur prev words cword
 
7
    _init_completion || return
10
8
 
11
9
    case $prev in
12
10
        -g|--openpgp-z)
13
 
            COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) )
 
11
            COMPREPLY=( $( compgen -W '{0..9}' -- "$cur" ) )
14
12
            return 0
15
13
            ;;
16
14
        -o|--keymode)
48
46
    esac
49
47
 
50
48
    if [[ "$cur" == -* ]]; then
51
 
        COMPREPLY=( $( compgen -W '--openpgp --openpgp-z \
52
 
            --decrypt --keysize --keymode --keyfile \
53
 
            --config --algorithm --algorithms-directory \
54
 
            --mode --modes-directory --hash --key \
55
 
            --noiv --bare --gzip --bzip2 --flush \
56
 
            --doublecheck --unlink --nodelete --time \
57
 
            --force --echo --random --list --list-keymodes \
58
 
            --list-hash --verbose --quiet --help \
59
 
            --version --license' -- "$cur" ) )
60
 
    elif [[ ${COMP_WORDS[0]} == mdecrypt ]]; then
 
49
        COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
 
50
    elif [[ ${words[0]} == mdecrypt ]]; then
61
51
        _filedir nc
62
52
    else
63
 
        decrypt=0
64
 
        for (( i=1; i < ${#COMP_WORDS[@]}-1; i++ )); do
65
 
            if [[ ${COMP_WORDS[i]} == -@(d|-decrypt) ]]; then
 
53
        local i decrypt=0
 
54
        for (( i=1; i < ${#words[@]}-1; i++ )); do
 
55
            if [[ ${words[i]} == -@(d|-decrypt) ]]; then
66
56
                _filedir nc
67
57
                decrypt=1
68
58
                break
75
65
} &&
76
66
complete -F _mcrypt mcrypt mdecrypt
77
67
 
78
 
# Local variables:
79
 
# mode: shell-script
80
 
# sh-basic-offset: 4
81
 
# sh-indent-comment: t
82
 
# indent-tabs-mode: nil
83
 
# End:
84
68
# ex: ts=4 sw=4 et filetype=sh