wombat/wombat.go
2019-01-01 19:41:03 +01:00

34 lines
986 B
Go

package main
import (
"fmt"
"git.gutmet.org/goutil.git"
"git.gutmet.org/simpleserver.git"
"git.gutmet.org/wombat.git/gallery"
"git.gutmet.org/wombat.git/generate"
"git.gutmet.org/wombat.git/initer"
"git.gutmet.org/wombat.git/post"
"os"
)
func serve(args []string) error {
simpleserver.Serve("stage2")
return nil
}
func main() {
commands := []goutil.Command{
goutil.NewCommandWithFlags("init", initer.Command, "initialize wombat directory"),
goutil.NewCommandWithFlags("gen", generate.Command, "generate the website"),
goutil.NewCommandWithFlags("post", post.Command, "create a new blogpost"),
goutil.NewCommand("serve", serve, "just execute web server"),
goutil.NewCommandWithFlags("genpics", gallery.Command, "generate galleries"),
goutil.NewCommand("newgallery", func([]string) error { return gallery.NewInteractive() }, "init new gallery (interactive)"),
}
err := goutil.Execute(commands)
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}