diff --git a/README.md b/README.md index 94524f2..6863abb 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ create `.licignore` in project root Install and run **GOLIC** ```shell # GO 1.16 -go install github.com/AbsaOSS/golic@v0.4.0 +go install github.com/AbsaOSS/golic@v0.4.2 golic inject -c="2021 MyCompany ltd." ``` diff --git a/cmd/inject.go b/cmd/inject.go index 09f19e2..11116ec 100644 --- a/cmd/inject.go +++ b/cmd/inject.go @@ -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) { diff --git a/cmd/version.go b/cmd/version.go new file mode 100644 index 0000000..1b7efb7 --- /dev/null +++ b/cmd/version.go @@ -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) +} \ No newline at end of file