forked from sumatrapdfreader/sumatrapdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwc.go
More file actions
28 lines (24 loc) · 685 Bytes
/
wc.go
File metadata and controls
28 lines (24 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package do
import "github.com/kjk/common/u"
// return false to exclude a file
func excludeFiles(s string) bool {
return true
}
var srcFiles = u.MakeAllowedFileFilterForExts(".go", ".cpp", ".h")
var excludeDirs = u.MakeExcludeDirsFilter("ext")
var allFiles = u.MakeFilterAnd(excludeDirs, excludeFiles, srcFiles)
func doLineCount() int {
stats := u.NewLineStats()
err := stats.CalcInDir("src", allFiles, true)
if err != nil {
logf("doWordCount: stats.wcInDir() failed with '%s'\n", err)
return 1
}
err = stats.CalcInDir("do", allFiles, true)
if err != nil {
logf("doWordCount: stats.wcInDir() failed with '%s'\n", err)
return 1
}
u.PrintLineStats(stats)
return 0
}