aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-10-09 00:44:37 +0200
committerMattias Andrée <maandree@operamail.com>2013-10-09 00:44:37 +0200
commit63e294327d914c99405572d4792b4db132761c5c (patch)
tree949c27b47c24e1ea28f76edd26371d073b6ccbd4
parentwhy bfind (diff)
downloadbfind-63e294327d914c99405572d4792b4db132761c5c.tar.gz
bfind-63e294327d914c99405572d4792b4db132761c5c.tar.bz2
bfind-63e294327d914c99405572d4792b4db132761c5c.tar.xz
implement --visible
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rwxr-xr-xsrc/bfind.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bfind.py b/src/bfind.py
index 6edd67c..bb8e3af 100755
--- a/src/bfind.py
+++ b/src/bfind.py
@@ -24,6 +24,7 @@ import os
xdev = False
hardlinks = False
symlinks = False
+visible = False
path = ''
for arg in sys.argv[1:]:
@@ -33,6 +34,7 @@ for arg in sys.argv[1:]:
if arg == '--xdev' or (arg[:2] != '--' and 'x' in arg): xdev = True
if arg == '--hardlinks' or (arg[:2] != '--' and 'h' in arg): hardlinks = True
if arg == '--symlinks' or (arg[:2] != '--' and 's' in arg): symlinks = True
+ if arg == '--visible' or (arg[:2] != '--' and 'v' in arg): visible = True
visited_name = set()
visited_id = set()
@@ -47,6 +49,8 @@ else:
while len(queue) > 0:
path = queue[1]
queue[:] = queue[1:]
+ if visible and (path.startswith('.') or ('/.' in path)):
+ continue
if hardlinks:
stat = os.stat(path)
stat = (stat.st_dev, stat.st_ino)