mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-27 19:54:24 +01:00
24 lines
345 B
Go
24 lines
345 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var Version = "version is set by build process"
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(versionCmd)
|
|
}
|
|
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "display gitleaks version",
|
|
Run: runVersion,
|
|
}
|
|
|
|
func runVersion(cmd *cobra.Command, args []string) {
|
|
fmt.Println(Version)
|
|
}
|