From a26f850c2372718d2b69d6b258d686c68ddba5ff Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sat, 20 Apr 2024 21:07:51 +0200 Subject: ref: Better doc and makefile It adds README explaining how to compile and install. Makefile allows to install dict system wide. --- cmd/dict/main.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'cmd') diff --git a/cmd/dict/main.go b/cmd/dict/main.go index 5bd6096..9dc98cf 100644 --- a/cmd/dict/main.go +++ b/cmd/dict/main.go @@ -1,16 +1,21 @@ package main import ( + "fmt" "log/slog" "os" + "path/filepath" "github.com/urfave/cli/v2" "git.gabrielgio.me/dict/cmd/importer" "git.gabrielgio.me/dict/cmd/server" "git.gabrielgio.me/dict/cmd/ui" + "git.gabrielgio.me/dict/db" ) +var Version = "local" + func main() { app := &cli.App{ Name: "dict", @@ -19,6 +24,16 @@ func main() { importer.ImportCommand, ui.UICommand, server.ServeCommand, + { + Name: "version", + Usage: "print current version", + Flags: []cli.Flag{}, + Action: func(cCtx *cli.Context) error { + fmt.Printf("%s - %s\n\n", filepath.Base(os.Args[0]), Version) + fmt.Printf("Spellfix locaton: %s.so", db.LibPath) + return nil + }, + }, }, } -- cgit v1.2.3