Skip to content

Commit

Permalink
add --skip-uniqueness option
Browse files Browse the repository at this point in the history
  • Loading branch information
Hideo Hattori committed Apr 5, 2016
1 parent e2a3ea2 commit 0661259
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions option.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package main
import "regexp"

type Options struct {
Byfile bool `long:"by-file" description:"report results for every source file encountered."`
SortTag string `long:"sort" default:"code" description:"sort based on a certain column"`
OutputType string `long:"output-type" default:"default" description:"output type [values: default,cloc-xml,sloccount]"`
ExcludeExt string `long:"exclude-ext" description:"exclude file name extensions (separated commas)"`
NotMatchDir string `long:"not-match-d" description:"exclude dir name (regex)"`
Debug bool `long:"debug" description:"dump debug log for developer"`
Byfile bool `long:"by-file" description:"report results for every source file encountered."`
SortTag string `long:"sort" default:"code" description:"sort based on a certain column"`
OutputType string `long:"output-type" default:"default" description:"output type [values: default,cloc-xml,sloccount]"`
ExcludeExt string `long:"exclude-ext" description:"exclude file name extensions (separated commas)"`
NotMatchDir string `long:"not-match-d" description:"exclude dir name (regex)"`
Debug bool `long:"debug" description:"dump debug log for developer"`
SkipUniqueness bool `long:"skip-uniqueness" description:"skip uniqueness files"`
}

const OutputTypeDefault string = "default"
Expand Down
3 changes: 2 additions & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ func getAllFiles(paths []string, languages map[string]*Language) (filenum, maxPa
return nil
}

if ignore := checkMD5Sum(p); ignore {
ignore := checkMD5Sum(p)
if !opts.SkipUniqueness && ignore {
if opts.Debug {
fmt.Printf("[ignore=%v] find same md5\n", p)
}
Expand Down

0 comments on commit 0661259

Please sign in to comment.