aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
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
+ },
+ },
},
}