summaryrefslogtreecommitdiffstats
path: root/completions/opera
blob: c9245e4b7761a46ef1f810214681be6f1fcea755 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# opera(1) completion                                      -*- shell-script -*-

_comp_cmd_opera()
{
    local cur prev words cword comp_args
    _comp_initialize -- "$@" || return

    case "$prev" in
        ?(-)-widget | ?(-)-urllist | ?(-)-uiparserlog | ?(-)-uiwidgetsparserlog | \
            ?(-)-profilinglog)
            _comp_compgen_filedir
            return
            ;;
        ?(-)-[psb]d)
            _comp_compgen_filedir -d
            return
            ;;
        ?(-)-remote)
            _comp_compgen -- -W 'openURL\\( openFile\\( openM2\\(
                openComposer\\( addBookmark\\( raise\\(\\) lower\\(\\)'
            [[ ${COMPREPLY-} == *\( ]] && compopt -o nospace
            return
            ;;
        ?(-)-windowname)
            _comp_compgen -- -W 'first last opera{1..9}'
            return
            ;;
        ?(-)-geometry | ?(-)-window | ?(-)-display | ?(-)-urllistloadtimeout | \
            ?(-)-delaycustomizations | ?(-)-dialogtest | ?(-)-inidialogtest | \
            ?(-)-gputest)
            # argument required but no completions available
            return
            ;;
    esac

    if [[ $cur == -* ]]; then
        _comp_compgen_help -- -help
        [[ ${COMPREPLY-} == *= ]] && compopt -o nospace
        return
    fi

    _comp_compgen_filedir '@(?([xX]|[sS])[hH][tT][mM]?([lL]))'
} &&
    complete -F _comp_cmd_opera opera

# ex: filetype=sh