From 5b9349bac2790cf92c22c908da0f1abe0abbeb4b Mon Sep 17 00:00:00 2001 From: Erik Hahn Date: Sat, 1 Aug 2009 16:59:08 +0200 Subject: [PATCH] Add NOTHING action for debugging --- ordnung.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ordnung.py b/ordnung.py index 5a0c735..aab02a6 100644 --- a/ordnung.py +++ b/ordnung.py @@ -127,6 +127,7 @@ def main(): COPY = 0 MOVE = 1 PREVIEW = 2 + NOTHING = 3 # Handle arguments usage = "Usage: %prog [options] directory pattern" @@ -146,6 +147,8 @@ def main(): const=COPY, dest="action", help="copy files") actions.add_option("--move", "-m", action="store_const", const=MOVE, dest="action", help="move files") + actions.add_option("--nothing", "-n", action="store_const", + const=MOVE, dest="action", help="do nothing (for debugging)") parser.add_option_group(actions) (options, args) = parser.parse_args() @@ -188,8 +191,10 @@ def main(): elif options.action == COPY: mkdir(tpath) shutil.copy2(i[0], tfile) - else: + elif options.action == PREVIEW: safeprint (i[0] + " --> " + tfile) + else: # options.action == NOTHING + pass if __name__ == "__main__": -- 2.11.4.GIT