aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-04-20 21:07:51 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-04-20 21:15:45 +0200
commita26f850c2372718d2b69d6b258d686c68ddba5ff (patch)
treeca45aa4a57ded8381d404804c4b07255fc01b563 /cmd
parent07f7f50fd5ff577896314984d1f365631be093bc (diff)
downloaddict-a26f850c2372718d2b69d6b258d686c68ddba5ff.tar.gz
dict-a26f850c2372718d2b69d6b258d686c68ddba5ff.tar.bz2
dict-a26f850c2372718d2b69d6b258d686c68ddba5ff.zip
ref: Better doc and makefile
It adds README explaining how to compile and install. Makefile allows to install dict system wide.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/dict/main.go15
1 files changed, 15 insertions, 0 deletions
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
+ },
+ },
},
}