From 63e294327d914c99405572d4792b4db132761c5c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 9 Oct 2013 00:44:37 +0200 Subject: implement --visible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/bfind.py | 4 ++++ 1 file changed, 4 insertions(+) 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) -- cgit v1.2.3-70-g09d2