Dirfirst option and numerical sorting (#27)

* Create option dirfirst, and add numerical sorting

* Add only dirfirst option
This commit is contained in:
Ivan Menshykov authored and gokcehan committed 2016-10-18 23:17:27 +03:00
1 parent d36e272272
commit 2345e16794
6 files changed
+20 -2

No files matched your search

+4 -2
View File
@@ -107,9 +107,11 @@ func organizeFiles(fi []os.FileInfo) []os.FileInfo {
log.Printf("unknown sorting type: %s", gOpts.sortby)
}
// TODO: these should be optional
if gOpts.dirfirst {
sort.Stable(ByDir(fi))
}
//TODO this should be optional
sort.Stable(ByNum(fi))
sort.Stable(ByDir(fi))
return fi
}