Skip to content

Commit

Permalink
version command
Browse files Browse the repository at this point in the history
  • Loading branch information
kuritka committed Mar 17, 2021
1 parent 77db5ea commit 5d7856e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ create `.licignore` in project root
Install and run **GOLIC**
```shell
# GO 1.16
go install github.com/AbsaOSS/[email protected].0
go install github.com/AbsaOSS/[email protected].2
golic inject -c="2021 MyCompany ltd."
```

Expand Down
2 changes: 1 addition & 1 deletion cmd/inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var injectOptions inject.Options

var injectCmd = &cobra.Command{
Use: "inject",
Short: "",
Short: "Injects license",
Long: ``,

Run: func(cmd *cobra.Command, args []string) {
Expand Down
21 changes: 21 additions & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package cmd

import (
"fmt"
"github.com/spf13/cobra"
)

const version = "v0.4.2"

var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number of Golic",
Long: "",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(version)
},
}

func init() {
rootCmd.AddCommand(versionCmd)
}

0 comments on commit 5d7856e

Please sign in to comment.