From 33f4c3117c51d9d0bff2c8f5bb921f4f10b2873e Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 4 Jan 2022 12:43:09 -0800 Subject: [PATCH] Improve inputrename fetching of input files. --- inputrename.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/inputrename.py b/inputrename.py index 40c287c..25d0c8f 100644 --- a/inputrename.py +++ b/inputrename.py @@ -11,10 +11,14 @@ from voussoirkit import spinal @pipeable.ctrlc_return1 def inputrename_argparse(args): + cwd = pathclass.cwd() if args.recurse: - files = (file for file in spinal.walk('.') if args.keyword in file.basename) + files = cwd.walk_files() else: - files = (file for file in pathclass.cwd().listdir() if args.keyword in file.basename) + files = cwd.listdir_files() + files = (file for file in files if args.keyword in file.basename) + files = sorted(files) + prev = None for file in files: pipeable.stderr(file.relative_path)