You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zk/main.go

32 lines
726 B
Go

3 years ago
package main
import (
"log"
"os"
3 years ago
"github.com/alecthomas/kong"
"github.com/mickael-menu/zk/adapter/handlebars"
3 years ago
"github.com/mickael-menu/zk/cmd"
"github.com/mickael-menu/zk/util/date"
3 years ago
)
var cli struct {
Init cmd.Init `cmd help:"Create a slip box in the given directory"`
New cmd.New `cmd help:"Add a new note to the slip box"`
3 years ago
}
func main() {
logger := log.New(os.Stderr, "zk: warning: ", 0)
// zk is short-lived, so we freeze the current date to use the same date
// for any rendering during the execution.
date := date.NewFrozenNow()
// FIXME take the language from the config
handlebars.Init("en", logger, &date)
3 years ago
ctx := kong.Parse(&cli,
kong.Name("zk"),
)
err := ctx.Run()
ctx.FatalIfErrorf(err)
}