File: crontab

package info (click to toggle)
yash 2.60-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,152 kB
  • sloc: ansic: 34,578; makefile: 851; sh: 808; sed: 16
file content (53 lines) | stat: -rw-r--r-- 1,572 bytes parent folder | download
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
47
48
49
50
51
52
53
# (C) 2010 magicant

# Completion script for the "crontab" command.
# Supports POSIX 2008, FreeBSD 8.1, OpenBSD 4.8, NetBSD 5.0, Mac OS X 10.6.3,
# SunOS 5.10, HP-UX 11i v3.

function completion/crontab {

        case $("${WORDS[1]}" --version 2>/dev/null) in
                (*'coreutils'*) typeset type=GNU ;;
                (*)             typeset type="$(uname 2>/dev/null)" ;;
        esac

        typeset OPTIONS ARGOPT PREFIX
        OPTIONS=()
        case $type in
        (SunOS|HP-UX)
                OPTIONS=("$OPTIONS" #>#
                "e:; edit crontab with an editor"
                "l:; print the current crontab setting"
                "r:; remove crontab setting"
                ) #<#
                ;;
        (*)
                OPTIONS=("$OPTIONS" #>#
                "e; edit crontab with an editor"
                "l; print the current crontab setting"
                "r; remove crontab setting"
                "u:; specify a user whose crontab is set, removed, or shown"
                ) #<#
                # We should check if crontab supports the -u option, but
                # there's no reliable way to do so. We just always complete the
                # -u option.
                ;;
        esac

        command -f completion//parseoptions
        case $ARGOPT in
        (-)
                command -f completion//completeoptions
                ;;
        (?)
                complete -u
                ;;
        (*)
                complete -f
                ;;
        esac

}


# vim: set ft=sh ts=8 sts=8 sw=8 et: