3fdd3d52271e

make --ignore work
[view raw] [browse files]
author Tony Wang <wwwjfy@gmail.com>
date Sun, 23 Mar 2014 17:38:16 +0800
parents a9e32bdb260b
children 799cd10dcfcf
branches/tags (none)
files ffind

Changes

--- a/ffind	Sun Mar 02 12:44:28 2014 -0500
+++ b/ffind	Sun Mar 23 17:38:16 2014 +0800
@@ -382,6 +382,10 @@
     return ignorers
 
 
+def parse_ignore_args():
+    return [compile_ff_glob(pattern) for pattern in options.ignore]
+
+
 def get_initial_ignorers():
     if '.ffignore' in options.ignore_files:
         home = os.environ.get('HOME')
@@ -460,7 +464,7 @@
 
 
 def _search(query, dir, depth, ignorers):
-    ignorers = ignorers + parse_ignore_files(dir)
+    ignorers = ignorers + parse_ignore_files(dir) + parse_ignore_args()
 
     contents = os.listdir(dir)
     next = []