Skip to content

Commit

Permalink
Add a version subcommand (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
akshit-deepsource authored Dec 22, 2022
1 parent 929bcd3 commit 8d9992f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions cmd/scatr/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package main

import (
"fmt"
"runtime"

"github.com/spf13/cobra"
)

const version = "0.2.1"

var versionCmd = &cobra.Command{
Use: "version",
Short: "Returns the current SCATR version",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("SCATR analyzer testing framework")
fmt.Println(" Version:", version)
fmt.Println()
fmt.Println("Environment:")
fmt.Println(" OS: ", runtime.GOOS)
fmt.Println(" ARCH:", runtime.GOARCH)
},
}

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

0 comments on commit 8d9992f

Please sign in to comment.