]> Cypherpunks.ru repositories - goredo.git/blobdiff - cleanup.go
No flags for not appropriate commands
[goredo.git] / cleanup.go
index 61f028f2d56dc6d600a1146ff1ac7d640f5cef56..52f149602a8af22e11fca86d146876e41510fcfb 100644 (file)
@@ -34,9 +34,14 @@ const (
        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)