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

« back to all changes in this revision

Viewing changes to completions/mdtool

  • 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
# mdtool completion                                        -*- shell-script -*-
 
2
 
 
3
_mdtool()
 
4
{
 
5
    local cur prev words cword
 
6
    _init_completion || return
 
7
 
 
8
    local command i
 
9
 
 
10
    for (( i=0; i < ${#words[@]}-1; i++ )); do
 
11
        if [[ ${words[i]} == @(build|generate-makefiles|setup) ]]; then
 
12
            command=${words[i]}
 
13
        fi
 
14
    done
 
15
 
 
16
    if [[ -n "$command" ]]; then
 
17
        case $command in
 
18
            "build")
 
19
                COMPREPLY=( $( compgen -W '--f --buildfile --p --project' \
 
20
                    -S":" -- "$cur" ) )
 
21
                # TODO: This does not work :(
 
22
                #if [[ "$prev" == *: ]]; then
 
23
                #   case $prev in
 
24
                #       @(--p:|--project:))
 
25
                #           COMPREPLY=( $( compgen -f -G "*.mdp" -- "$cur" ) )
 
26
                #           ;;
 
27
                #       @(--f:|--buildfile:))
 
28
                #           COMPREPLY=( $( compgen -f -G "*.mdp" -G "*.mds" -- "$cur" ) )
 
29
                #           ;;
 
30
                #   esac
 
31
                #fi
 
32
                return 0
 
33
                ;;
 
34
            "generate-makefiles")
 
35
                compopt -o filenames
 
36
                COMPREPLY=( $( compgen -o filenames -G"*.mds" -- "$cur" ) )
 
37
                if [[ "$prev" == *mds ]]; then
 
38
                    COMPREPLY=( $( compgen -W '--simple-makefiles --s --d:' \
 
39
                        -- "$cur" ) )
 
40
                fi
 
41
                return 0
 
42
                ;;
 
43
            "setup")
 
44
                # TODO: at least return filenames after these options.
 
45
                COMPREPLY=( $( compgen -W 'install i uninstall u check-install \
 
46
                    ci update up list l list-av la list-update lu rep-add ra \
 
47
                    rep-remove rr rep-update ru rep-list rl reg-update \
 
48
                    reg-build rgu info rep-build rb pack p help h dump-file' \
 
49
                    -- "$cur" ) )
 
50
                return 0
 
51
                ;;
 
52
        esac
 
53
    fi
 
54
 
 
55
    COMPREPLY=( $( compgen -W 'gsetup build dbgen project-export \
 
56
        generate-makefiles gettext-update setup -q' -- "$cur" ) )
 
57
 
 
58
    return 0
 
59
} &&
 
60
complete -F _mdtool mdtool
 
61
 
 
62
# ex: ts=4 sw=4 et filetype=sh