summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorKujtim Hoxha <[email protected]>2025-04-23 12:26:50 +0200
committerKujtim Hoxha <[email protected]>2025-04-24 16:40:36 +0200
commitf879a94c95678592060b3ade1d78f69f18c5866e (patch)
tree34698909bc155d2d3203c980d181355316fb1ead /cmd
parent6d05d5a7c3bf29bd0586504e8721550c8a10dc4c (diff)
downloadopencode-f879a94c95678592060b3ade1d78f69f18c5866e.tar.gz
opencode-f879a94c95678592060b3ade1d78f69f18c5866e.zip
update mainter email
Diffstat (limited to 'cmd')
-rw-r--r--cmd/root.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/root.go b/cmd/root.go
index 8777acb82..c2c1d9d84 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -15,6 +15,7 @@ import (
"github.com/kujtimiihoxha/opencode/internal/logging"
"github.com/kujtimiihoxha/opencode/internal/pubsub"
"github.com/kujtimiihoxha/opencode/internal/tui"
+ "github.com/kujtimiihoxha/opencode/internal/version"
zone "github.com/lrstanley/bubblezone"
"github.com/spf13/cobra"
)
@@ -31,6 +32,10 @@ to assist developers in writing, debugging, and understanding code directly from
cmd.Help()
return nil
}
+ if cmd.Flag("version").Changed {
+ fmt.Println(version.Version)
+ return nil
+ }
// Load the config
debug, _ := cmd.Flags().GetBool("debug")
@@ -247,6 +252,7 @@ func Execute() {
func init() {
rootCmd.Flags().BoolP("help", "h", false, "Help")
+ rootCmd.Flags().BoolP("version", "v", false, "Version")
rootCmd.Flags().BoolP("debug", "d", false, "Debug")
rootCmd.Flags().StringP("cwd", "c", "", "Current working directory")
}