Skip to content

Commit

Permalink
Add version command
Browse files Browse the repository at this point in the history
Signed-off-by: Lou Marvin Caraig <[email protected]>
  • Loading branch information
se7entyse7en committed Jun 27, 2020
1 parent af3406c commit 978b39d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"github.com/spf13/cobra"
)

var VERSION = "0.5.0"

var rootCmd = &cobra.Command{
Use: "pydockenv",
Short: "A CLI tool to handle Python virtual environments",
Expand Down
19 changes: 19 additions & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"fmt"

"github.com/spf13/cobra"
)

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

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

0 comments on commit 978b39d

Please sign in to comment.