Command line flags

This commit is contained in:
Jakob Borg
2013-12-18 19:36:28 +01:00
parent f774b0a5dc
commit eba1c9e649
4 changed files with 62 additions and 90 deletions

View File

@@ -62,7 +62,7 @@ func genWalker(base string, res *[]File, model *Model) filepath.WalkFunc {
// No change
*res = append(*res, hf)
} else {
if traceFile {
if opts.Debug.TraceFile {
debugf("FILE: Hash %q", p)
}
fd, err := os.Open(p)
@@ -97,7 +97,7 @@ func Walk(dir string, model *Model, followSymlinks bool) []File {
warnln(err)
}
if followSymlinks {
if !opts.NoSymlinks {
d, err := os.Open(dir)
if err != nil {
warnln(err)
@@ -127,7 +127,7 @@ func cleanTempFile(path string, info os.FileInfo, err error) error {
return err
}
if info.Mode()&os.ModeType == 0 && isTempName(path) {
if traceFile {
if opts.Debug.TraceFile {
debugf("FILE: Remove %q", path)
}
os.Remove(path)