Commits

Phillip Alday committed 8c53d2d

Added the ability to specify multiple extensions.

  • Participants
  • Parent commits 38970d6

Comments (0)

Files changed (1)

                         help="Prompt for action by duplicate sets.")
     parser.add_argument('path', type=str, nargs='+',
                         help="paths to search")
-    parser.add_argument('-e','--extension', type=str, default=None,
+    parser.add_argument('-e','--extension', type=str, default=None, nargs='+',
                         help="Limit search to files of a certain extension.")
 
     args = parser.parse_args(argv)
         if os.path.isdir(ddir):
             for root, dirs, fnames in os.walk(ddir):
                 for f in fnames:
-                    if ext is None or os.path.splitext(f)[1] == ext:
+                    if ext is None or os.path.splitext(f)[1] in ext:
                             yield os.path.join(root, f)
         else:
-            if ext is None or os.path.splitext(f)[1] == ext:
+            if ext is None or os.path.splitext(f)[1] in ext:
                     yield ddir
 
 def group_pairs(pairs):