Update inputrename.py.

master
voussoir 2020-12-07 20:31:10 -08:00
parent b51c8032ac
commit ef600c8f29
1 changed files with 8 additions and 11 deletions

View File

@ -1,15 +1,15 @@
'''
Given a target string to replace, rename files by prompting the user for input.
'''
import argparse
import os
import sys
from voussoirkit import winglob
import argparse
import sys
from voussoirkit import pipeable
@pipeable.ctrlc_return1
def inputrename_argparse(args):
pattern = f'*{args.keyword}*'
files = winglob.glob(pattern)
files = (file for file in os.listdir() if args.keyword in file)
prev = None
for file in files:
print(file)
@ -30,7 +30,4 @@ def main(argv):
return args.func(args)
if __name__ == '__main__':
try:
raise SystemExit(main(sys.argv[1:]))
except KeyboardInterrupt:
raise SystemExit(1)
raise SystemExit(main(sys.argv[1:]))