File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -7,16 +7,22 @@ import (
7
7
"github.com/spf13/cobra"
8
8
)
9
9
10
+ type CliOptions struct {
11
+ Version string
12
+ }
13
+
10
14
var rootCmd = & cobra.Command {
11
15
Use : "numscript" ,
12
- Short : "Numscript cli" , // TODO better descr
16
+ Short : "Numscript cli" ,
13
17
Long : "Numscript cli" ,
14
18
CompletionOptions : cobra.CompletionOptions {
15
19
DisableDefaultCmd : true ,
16
20
},
17
21
}
18
22
19
- func Execute () {
23
+ func Execute (options CliOptions ) {
24
+ rootCmd .Version = options .Version
25
+
20
26
rootCmd .AddCommand (lspCmd )
21
27
rootCmd .AddCommand (checkCmd )
22
28
Original file line number Diff line number Diff line change @@ -35,5 +35,7 @@ func main() {
35
35
defer recoverPanic ()
36
36
defer sentry .Flush (2 * time .Second )
37
37
38
- cmd .Execute ()
38
+ cmd .Execute (cmd.CliOptions {
39
+ Version : Version ,
40
+ })
39
41
}
You can’t perform that action at this time.
0 commit comments