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

« back to all changes in this revision

Viewing changes to completions/gphoto2

  • Committer: Package Import Robot
  • Author(s): Dimitri John Ledkov
  • Date: 2013-12-27 01:28:28 UTC
  • mfrom: (5.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20131227012828-svk9wdy2ghic0cfh
Tags: 1:2.1-2ubuntu1
* Resync with Debian, remaining diff
  * debian/patches/disable-avahi-browse.diff: Disable avahi-browse since
    it scales poorly in the current form: refresh patch
  * mark Multi-Arch:foreign
  * debian/maintscript, debian/postinst:
    - clean etc conffiles on upgrade since completion files are in /usr
      with the new version
  * patches/101_bash_completion.oga_ogv.patch: Increase support for other
    OGG formats including .oga, .ogx, etc. (LP: #311525)

* Dropped changes:
  - patches/103_colormake.patch: Add support for colormake to the make
    completion rules. (LP: #743208)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# bash completion for gphoto2(1)                           -*- shell-script -*-
 
2
 
 
3
_gphoto2()
 
4
{
 
5
    local cur prev words cword split
 
6
    _init_completion -s || return
 
7
 
 
8
    case $prev in
 
9
        --debug-logfile)
 
10
            _filedir
 
11
            return 0
 
12
            ;;
 
13
        --hook-script)
 
14
            _filedir
 
15
            return 0
 
16
            ;;
 
17
        --filename)
 
18
            _filedir
 
19
            return 0
 
20
            ;;
 
21
        -u|--upload-file)
 
22
            _filedir
 
23
            return 0
 
24
            ;;
 
25
        --port)
 
26
            COMPREPLY=( $(compgen -W "$( gphoto2 --list-ports 2>/dev/null | \
 
27
                tail -n +4 | awk '{ print $1 }'  )" -- "$cur") )
 
28
            return 0
 
29
            ;;
 
30
        --camera)
 
31
            local IFS=$'\n'
 
32
            COMPREPLY=( $(compgen -W "$( gphoto2 --list-cameras 2>/dev/null | \
 
33
                tail -n +3 | awk -F'"' '{ print $2 }'  )" -- "$cur") )
 
34
            return 0
 
35
            ;;
 
36
        --get-config|--set-config|--set-config-index|--set-config-value)
 
37
            COMPREPLY=( $(compgen -W "$( gphoto2 --list-config 2>/dev/null \
 
38
                )" -- "$cur") )
 
39
            return 0
 
40
            ;;
 
41
    esac
 
42
 
 
43
    if [[ "$cur" == -* ]]; then
 
44
        COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
 
45
        return 0
 
46
    fi
 
47
 
 
48
} &&
 
49
complete -F _gphoto2 gphoto2
 
50
 
 
51
# ex: ts=4 sw=4 et filetype=sh