Skip to content

Commit

Permalink
Add version
Browse files Browse the repository at this point in the history
  • Loading branch information
rumpl committed May 10, 2020
1 parent 0e39edb commit 6ccfa40
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import (
"github.com/spf13/cobra"
)

var (
version = "dev"
)

type depSize struct {
name string
size int64
Expand Down Expand Up @@ -139,8 +143,9 @@ type rootOpts struct {
func main() {
var opts rootOpts
root := cobra.Command{
Use: "dep-sum",
Args: cobra.ExactArgs(1),
Use: "dep-sum",
Version: version,
Args: cobra.ExactArgs(1),
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if opts.verbose {
logrus.SetLevel(logrus.DebugLevel)
Expand Down

0 comments on commit 6ccfa40

Please sign in to comment.