diff options
| author | Zach DeCook <zach.decook@bettercarpeople.com> | 2023-06-27 20:00:54 -0400 |
|---|---|---|
| committer | Zach DeCook <zach.decook@bettercarpeople.com> | 2023-06-27 20:00:54 -0400 |
| commit | 9f6f29edf5d43826ef283dcba89f5aefe93430ef (patch) | |
| tree | c05d2d5dfeefd90b538483e1bda453cc11b01fb4 /.local/bin/mfi.py | |
| parent | 368e163aeb3e10a48d124924cb2f8c38b2b5ab98 (diff) | |
| download | dotfiles-9f6f29edf5d43826ef283dcba89f5aefe93430ef.tar.gz | |
changes: yeah
Diffstat (limited to '.local/bin/mfi.py')
| -rwxr-xr-x | .local/bin/mfi.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/.local/bin/mfi.py b/.local/bin/mfi.py new file mode 100755 index 0000000..8cd19cd --- /dev/null +++ b/.local/bin/mfi.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +import sys +import subprocess + +args = sys.argv[1:] +subs = [] +nums = [] +for arg in args: + file = arg.split(':')[0] + r = subprocess.run(['find', '.', '-name', file],stdout=subprocess.PIPE) + subs.append(r) + if ':' in arg: + nums.append(arg.split(':')[1]) + else: + nums.append(0) + +nums.reverse() +args = ['micro'] +for sub in subs: + n = nums.pop() + files = r.stdout.decode().strip().split('\n') + for file in files: + args.append(file+":"+n) + +subprocess.run(args) |
