summary refs log tree commit diff
path: root/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/mfi.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/.local/bin/mfi.py b/.local/bin/mfi.py
index 41bdf7c..b18f620 100755
--- a/.local/bin/mfi.py
+++ b/.local/bin/mfi.py
@@ -7,8 +7,11 @@ files = []
 nums = {}
 for arg in args:
     file = arg.split(':')[0]
-    r = subprocess.run(['find', '.', '-name', file],stdout=subprocess.PIPE)
-    files += r.stdout.decode().strip().split('\n')
+    if '/' in file:
+        r = subprocess.run(['find', '.', '-wholename', '*'+file],stdout=subprocess.PIPE)
+    else:
+        r = subprocess.run(['find', '.', '-name', file],stdout=subprocess.PIPE)
+    files += (r.stdout.decode().strip() or file).split('\n')
     if ':' in arg:
         nums[file] = arg.split(':')[1]
     else:
@@ -16,7 +19,8 @@ for arg in args:
 
 args = ['micro']
 for file in files:
-        n = nums[file.split('/')[-1]]
+    if file:
+        n = nums.get(file, nums.get(file.split('/')[-1], 0))
         args.append(file+":"+str(n))
 
 #print(args)