Skip to content

Commit 9c99e99

Browse files
committed
Added version sub-command
1 parent 132008d commit 9c99e99

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cmd/root.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,17 @@ import (
1313

1414
var (
1515
cfgFile string
16+
version string = "0.0.9"
1617
rootCmd = &cobra.Command{
1718
Use: "ghost",
1819
Short: fmt.Sprintf("\n%v Ghost is an experimental CLI that intelligently scaffolds a GitHub Action workflow based on your local application stack and natural language, using OpenAI.", emoji.Ghost),
1920
}
21+
versionCmd = &cobra.Command{
22+
Use: "version",
23+
Run: func(cmd *cobra.Command, args []string) {
24+
fmt.Printf("Ghost Version: %v", version)
25+
},
26+
}
2027
)
2128

2229
func Execute() error {
@@ -31,6 +38,7 @@ func init() {
3138

3239
rootCmd.CompletionOptions.HiddenDefaultCmd = true
3340
rootCmd.AddCommand(runCmd, configCmd)
41+
rootCmd.AddCommand(versionCmd)
3442
}
3543

3644
func InitConfig() {
@@ -59,4 +67,4 @@ func InitConfig() {
5967
}
6068
}
6169
}
62-
}
70+
}

0 commit comments

Comments
 (0)