0e947252dd46

Merge pull request #10 from llimllib/master

Add an option to print the abspath instead of relative path
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 09 Dec 2015 11:55:13 +0000
parents b9310be6f582 (current diff) 81501b0cf30f (diff)
children 4602c8a6735a
branches/tags (none)
files ffind

Changes

--- a/ffind	Wed Dec 09 11:53:08 2015 +0000
+++ b/ffind	Wed Dec 09 11:55:13 2015 +0000
@@ -474,6 +474,9 @@
 
     for item in contents:
         path = os.path.join(dir, item)
+        if options.print_fullname:
+            path = os.path.abspath(path)
+
         if not should_ignore(item, path, ignorers):
             if match(query, path, item):
                 out(path, '\0' if options.zero else '\n')
@@ -524,6 +527,9 @@
     p.add_option('-E', '--non-entire', dest='entire',
                  action='store_false',
                  help='match PATTERN against only the filenames (default)')
+    p.add_option('-p', '--fullname', dest='print_fullname',
+                  action='store_true', default=False,
+                  help="print the file's full name")
 
     # Case sensitivity
     g = OptionGroup(p, "Configuring Case Sensitivity")