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

« back to all changes in this revision

Viewing changes to completions/fbi

  • 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 fbi(1)                               -*- shell-script -*-
 
2
 
 
3
_fbi()
 
4
{
 
5
    local cur prev words cword
 
6
    _init_completion || return
 
7
 
 
8
    case "$prev" in
 
9
        -l|--list)
 
10
            _filedir
 
11
            return
 
12
            ;;
 
13
        -r|--resolution)
 
14
            COMPREPLY+=( $( compgen -W '{1..5}' ) )
 
15
            return
 
16
            ;;
 
17
        -f|--font)
 
18
            local IFS=$'\n'
 
19
            COMPREPLY=( $( compgen -W '$( fc-list 2> /dev/null )' -- "$cur" ) )
 
20
            return
 
21
            ;;
 
22
        -m|--mode)
 
23
            COMPREPLY=( $( compgen -W '$( sed \
 
24
                -n "/^mode/{s/^mode \{1,\}\"\([^\"]\{1,\}\)\"/\1/g;p}" \
 
25
                /etc/fb.modes 2> /dev/null )' -- "$cur" ) )
 
26
            return
 
27
            ;;
 
28
        -d|--device)
 
29
            COMPREPLY=( $( compgen -f -d -- "${cur:-/dev/}" ) )
 
30
            return
 
31
            ;;
 
32
        --cachemem|--blend|-T|--vt|-s|--scroll|-t|--timeout|-g|--gamma)
 
33
            # argument required but no completions available
 
34
            return
 
35
            ;;
 
36
    esac
 
37
 
 
38
    if [[ "$cur" == -* ]]; then
 
39
        COMPREPLY=( $( compgen -W '--help --version --store --list --text
 
40
            --autozoom --{,no}autoup --{,no}autodown --{,no}fitwidth
 
41
            --{,no}verbose --{,no}random --{,no}comments --{,no}edit
 
42
            --{,no}backup --{,no}preserve --{,no}readahead --cachemem --blend
 
43
            --vt --scroll --timeout --{,no}once --resolution --gamma --font
 
44
            --device --mode' -- "$cur" ) )
 
45
        [[ $COMPREPLY ]] && return
 
46
    fi
 
47
 
 
48
    # FIXME: It is hard to determine correct supported extensions.
 
49
    # fbi can handle any format that imagemagick can plus some others
 
50
    _filedir 'bmp|gif|jp?(e)g|pcd|png|p[pgb]m|tif?(f)|webp|xpm|xwd|?(e)ps|pdf|dvi|txt|svg?(z)|cdr|[ot]tf'
 
51
} && complete -F _fbi fbi
 
52
 
 
53
# ex: ts=4 sw=4 et filetype=sh