File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ import (
1313 "github.com/jessevdk/go-flags"
1414)
1515
16+ const version = "0.5.0"
17+
1618func init () {
1719 loads .AddLoader (fmts .YAMLMatcher , fmts .YAMLDoc )
1820}
@@ -21,6 +23,7 @@ var opts struct {
2123 // General options applicable to all commands
2224 Quiet func () `long:"quiet" short:"q" description:"silence logs"`
2325 LogFile func (string ) `long:"log-output" description:"redirect logs to file" value-name:"LOG-FILE"`
26+ Version func () `long:"version" short:"v" description:"print the version of kcl-openapi"`
2427}
2528
2629// Generate command to group all generator commands together
@@ -58,7 +61,10 @@ func Main() {
5861 cmd .LongDescription = cmd .ShortDescription
5962 }
6063 }
61-
64+ opts .Version = func () {
65+ println ("kcl-openapi" , version )
66+ os .Exit (0 )
67+ }
6268 opts .Quiet = func () {
6369 log .SetOutput (ioutil .Discard )
6470 }
You can’t perform that action at this time.
0 commit comments