CleanupTmp = "tmp"
)
-var (
- DryRun = flag.Bool("dry-run", false, "do no delete files during cleanup, just show them")
-)
+var DryRun *bool
+
+func init() {
+ if CmdName() != CmdNameRedoCleanup {
+ return
+ }
+ DryRun = flag.Bool("n", false, "do no delete files during cleanup, just show them")
+}
func redoDirClean(root, what string) error {
root, err := filepath.Abs(root)
pth = cwdMustRel(root, fi.Name())
switch what {
case CleanupLog:
- if strings.HasSuffix(fi.Name(), LogSuffix) {
+ if strings.HasSuffix(fi.Name(), LogSuffix) ||
+ strings.HasSuffix(fi.Name(), LogRecSuffix) {
fmt.Println(pth)
if !*DryRun {
if err = os.Remove(pth); err != nil {