From 5063b774c13ab62786112080724ce28506fe7a99 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 21 Oct 2025 01:56:44 +0900 Subject: [PATCH] hst: expose version string The hst API is tied to this version string. Signed-off-by: Ophestra --- cmd/hakurei/print.go | 4 +++- hst/hst.go | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/hakurei/print.go b/cmd/hakurei/print.go index 86fc1ed..b09ba4a 100644 --- a/cmd/hakurei/print.go +++ b/cmd/hakurei/print.go @@ -12,6 +12,7 @@ import ( "time" "hakurei.app/hst" + "hakurei.app/internal" "hakurei.app/internal/app" "hakurei.app/internal/app/state" "hakurei.app/message" @@ -21,7 +22,7 @@ func printShowSystem(output io.Writer, short, flagJSON bool) { t := newPrinter(output) defer t.MustFlush() - info := &hst.Info{User: new(app.Hsu).MustID(nil)} + info := &hst.Info{Version: internal.Version(), User: new(app.Hsu).MustID(nil)} app.CopyPaths().Copy(&info.Paths, info.User) if flagJSON { @@ -29,6 +30,7 @@ func printShowSystem(output io.Writer, short, flagJSON bool) { return } + t.Printf("Version:\t%s\n", info.Version) t.Printf("User:\t%d\n", info.User) t.Printf("TempDir:\t%s\n", info.TempDir) t.Printf("SharePath:\t%s\n", info.SharePath) diff --git a/hst/hst.go b/hst/hst.go index c1511f6..7fd7619 100644 --- a/hst/hst.go +++ b/hst/hst.go @@ -52,7 +52,10 @@ type Paths struct { RunDirPath *check.Absolute `json:"run_dir_path"` } +// Info holds basic system information collected from the implementation. type Info struct { + // Version is a hardcoded version string. + Version string `json:"version"` // User is the userid according to hsu. User int `json:"user"`