-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
35 lines (31 loc) · 1.18 KB
/
main.go
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
// Copyright 2019 Sevki <s@sevki.org>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// cronexp draws a very nice table of what your cron job will do
// like so
//
// ┌───────────────────minutes [0s 15m0s 30m0s 45m0s]
// │ ┌──────────────hours [0s]
// │ │ ┌────────────days of the month [1 15]
// │ │ │ ┌───────months [January February March April May June July August September October November December]
// │ │ │ │ ┌─────days of the week [Monday Tuesday Wednesday Thursday Friday]
// │ │ │ │ │ ┌─args [/usr/bin/find]
// */15 0 1,15 * 1-5 /usr/bin/find
//
// Important '*' is a wildcard character in most shells.
// either escape it with \* or run with
//
// set -f
// cronexp */15 0 1,15 * 1-5 /usr/bin/find
//
package main
import (
"flag"
"fmt"
"sevki.org/x/cron"
)
func main() {
fset := cron.NewFlagSet("test", flag.PanicOnError)
fset.Parse()
fmt.Println(fset.CronTab())
}