summaryrefslogtreecommitdiffstats
path: root/completions/cancel
blob: 38571c509792c5ce66871c8ed2e51f51e76c3b7d (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
# cancel(1) completion                                     -*- shell-script -*-

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

    case $prev in
        -h)
            _comp_compgen_known_hosts -- "$cur"
            return
            ;;
        -U)
            return
            ;;
        -u)
            _comp_compgen -- -u
            return
            ;;
    esac

    _comp_compgen_split -- "$(lpstat 2>/dev/null | cut -d' ' -f1)"
} &&
    complete -F _comp_cmd_cancel cancel

# ex: filetype=sh