File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,15 @@ var (
1919var rootCmd = & cobra.Command {
2020 Use : "bootstrap" ,
2121 Short : "Scaffold and manage production-ready Go services." ,
22- Long : `BootstrapCLI is a project lifecycle tool for Go services,
22+ Long : `BootstrapCLI is a project lifecycle tool for Go services.
2323It helps you create, configure, and evolve Go projects using
24- opinionated defaults, a clear project structure, and
25- declarative configuration.` ,
26- Version : Version ,
24+ opinionated defaults and a clear project structure.` ,
2725 Run : func (cmd * cobra.Command , args []string ) {
26+ v , _ := cmd .Flags ().GetBool ("version" )
27+ if v {
28+ fmt .Print (cmd .VersionTemplate ())
29+ return
30+ }
2831 _ = cmd .Help ()
2932 },
3033}
@@ -36,7 +39,8 @@ func Execute() {
3639}
3740
3841func init () {
39- rootCmd .Version = Version
42+ rootCmd .Flags ().BoolP ("version" , "v" , false , "print version information" )
43+
4044 rootCmd .SetVersionTemplate (
4145 fmt .Sprintf (
4246 "bootstrap-cli %s\n Commit: %s\n Built: %s\n " ,
You can’t perform that action at this time.
0 commit comments