2024-02-09 16:04:40 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-02-24 16:39:45 +01:00
|
|
|
"github.com/alecthomas/kong"
|
2024-02-16 19:29:43 +01:00
|
|
|
"github.com/facundoolano/jorge/commands"
|
2024-02-09 16:04:40 +01:00
|
|
|
)
|
|
|
|
|
2024-02-24 16:39:45 +01:00
|
|
|
var cli struct {
|
|
|
|
Init commands.Init `cmd:"" help:"Initialize a new website project." aliases:"i"`
|
|
|
|
Build commands.Build `cmd:"" help:"Build a website project." aliases:"b"`
|
2024-02-29 23:34:33 +01:00
|
|
|
Post commands.Post `cmd:"" help:"Initialize a new post template file." aliases:"p"`
|
2024-02-24 16:39:45 +01:00
|
|
|
Serve commands.Serve `cmd:"" help:"Run a local server for the website." aliases:"s"`
|
2024-09-17 01:16:30 +02:00
|
|
|
Meta commands.Meta `cmd:"" help:"Get the JSON results from evaluating a liquid template expression within the site context." aliases:"m"`
|
2024-02-24 16:39:45 +01:00
|
|
|
Version kong.VersionFlag `short:"v"`
|
2024-02-10 15:37:38 +01:00
|
|
|
}
|
|
|
|
|
2024-02-24 16:39:45 +01:00
|
|
|
func main() {
|
|
|
|
ctx := kong.Parse(
|
|
|
|
&cli,
|
|
|
|
kong.UsageOnError(),
|
|
|
|
kong.HelpOptions{FlagsLast: true},
|
2024-11-10 17:21:13 +01:00
|
|
|
kong.Vars{"version": "jorge v0.9.1"},
|
2024-02-24 16:39:45 +01:00
|
|
|
)
|
|
|
|
err := ctx.Run()
|
|
|
|
ctx.FatalIfErrorf(err)
|
2024-02-09 16:04:40 +01:00
|
|
|
}
|