Only log skipped files in verbose mode
This commit is contained in:
committed by
Will Norris
parent
6c3d2501f2
commit
eadb73ac0d
6
main.go
6
main.go
@@ -58,7 +58,7 @@ var (
|
||||
license = flag.String("l", "apache", "license type: apache, bsd, mit, mpl")
|
||||
licensef = flag.String("f", "", "license file")
|
||||
year = flag.String("y", fmt.Sprint(time.Now().Year()), "copyright year(s)")
|
||||
verbose = flag.Bool("v", false, "verbose mode: print the name of the files that are modified")
|
||||
verbose = flag.Bool("v", false, "verbose mode: print the name of the files that are modified or were skipped")
|
||||
checkonly = flag.Bool("check", false, "check only mode: verify presence of license headers and exit with non-zero code if missing")
|
||||
)
|
||||
|
||||
@@ -217,7 +217,9 @@ func walk(ch chan<- *file, start string) error {
|
||||
return nil
|
||||
}
|
||||
if fileMatches(path, ignorePatterns) {
|
||||
log.Printf("skipping: %s", path)
|
||||
if *verbose {
|
||||
log.Printf("skipping: %s", path)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
ch <- &file{path, fi.Mode()}
|
||||
|
||||
Reference in New Issue
Block a user