summaryrefslogtreecommitdiff
path: root/completions/cancel
blob: 3e0c1d527352ed1aaa1249add5dda0af812e9b34 (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
# cancel(1) completion                                     -*- shell-script -*-

_cancel()
{
    local cur prev words cword
    _init_completion || return

    case $prev in
        -h)
            _known_hosts_real -- "$cur"
            return
            ;;
        -U)
            return
            ;;
        -u)
            COMPREPLY=($(compgen -u -- "$cur"))
            return
            ;;
    esac

    COMPREPLY=($(compgen -W \
        "$(lpstat 2>/dev/null | cut -d' ' -f1)" -- "$cur"))
} &&
    complete -F _cancel cancel

# ex: filetype=sh