summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gotosocial/main.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd/gotosocial/main.go b/cmd/gotosocial/main.go
index 27810a80b..9729f7706 100644
--- a/cmd/gotosocial/main.go
+++ b/cmd/gotosocial/main.go
@@ -33,12 +33,19 @@ import (
"github.com/urfave/cli/v2"
)
+// Version is the software version of GtS being used
+var Version string
+
+// Commit is the git commit of GtS being used
+var Commit string
+
func main() {
flagNames := config.GetFlagNames()
envNames := config.GetEnvNames()
defaults := config.GetDefaults()
app := &cli.App{
- Usage: "a fediverse social media server",
+ Version: Version + " " + Commit[:7],
+ Usage: "a fediverse social media server",
Flags: []cli.Flag{
// GENERAL FLAGS
&cli.StringFlag{
@@ -399,7 +406,7 @@ func runAction(c *cli.Context, a cliactions.GTSAction) error {
return fmt.Errorf("error creating config: %s", err)
}
// ... and the flags set on the *cli.Context by urfave
- if err := conf.ParseCLIFlags(c); err != nil {
+ if err := conf.ParseCLIFlags(c, c.App.Version); err != nil {
return fmt.Errorf("error parsing config: %s", err)
}