Selaa lähdekoodia

Opt version (#80)

* version opt

* change-log
Zachary Rice 7 vuotta sitten
vanhempi
commit
60801b336a
3 muutettua tiedostoa jossa 60 lisäystä ja 1 poistoa
  1. 52 0
      CHANGELOG.md
  2. 2 1
      Makefile
  3. 6 0
      main.go

+ 52 - 0
CHANGELOG.md

@@ -0,0 +1,52 @@
+CHANGELOG
+=========
+
+1.1.2
+-----
+- Added version option
+- Introduced changelog
+
+1.1.1
+-----
+- Fixed commit patch order
+- Updated Readme
+
+1.1.0
+-----
+- Fixed Twitter typo
+- Fixed sample docker command
+- Default clone option to "in-memory"
+- Added clone option for "disk"
+- Updated Makefile
+
+1.0.0
+-----
+- Rewrite, see Readme.md: https://github.com/zricethezav/gitleaks/releases/tag/v1.0.0
+
+0.4.0
+-----
+- Added support for external regexes
+
+0.3.0
+-----
+- Added local scan
+- Meaningful exit codes
+- Timestamped logs
+- Refactored for some maintainability
+
+0.2.0
+-----
+- Additionally regex checking
+- $HOME/.gitleaks/ directory for clones and reports
+- Pagination for Org/User list... no more partial repo lists
+- Persistent repos for Orgs and Users (no more re-cloning)
+- Updated README
+- Multi-staged Docker build
+- Travis CI
+
+0.1.0
+-----
+- full git history search
+- regex/entropy checks
+- report generation
+

+ 2 - 1
Makefile

@@ -1,4 +1,4 @@
-.PHONY: test build-all release
+.PHONY: test build-all deploy
 
 test:
 	go get github.com/golang/lint/golint
@@ -12,6 +12,7 @@ deploy:
 	docker push $(REPO)
 
 build-all:
+	rm -rf build
 	mkdir build
 	env GOOS="windows" GOARCH="amd64" go build -o "build/gitleaks-windows-amd64.exe"
 	env GOOS="windows" GOARCH="386" go build -o "build/gitleaks-windows-386.exe"

+ 6 - 0
main.go

@@ -92,6 +92,7 @@ type Options struct {
 	Verbose bool   `short:"v" long:"verbose" description:"Show verbose output from gitleaks audit"`
 	Report  string `long:"report" description:"path to write report file"`
 	Redact  bool   `long:"redact" description:"redact secrets from log messages and report"`
+	Version bool   `long:"version" description:"version number"`
 }
 
 // Config struct for regexes matching and whitelisting
@@ -108,6 +109,7 @@ type Config struct {
 	}
 }
 
+const version = "1.1.2"
 const defaultConfig = `
 title = "gitleaks config"
 # add regexes to the regex table
@@ -178,6 +180,10 @@ func main() {
 		repos []Repo
 	)
 	_, err := flags.Parse(&opts)
+	if opts.Version {
+		fmt.Println(version)
+		os.Exit(0)
+	}
 	if err != nil {
 		os.Exit(1)
 	}