From af9ae8f5acec95d2db30d196acba69663654651d Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 25 May 2021 01:40:34 -0700 Subject: [PATCH] Use pipeable.input_many. --- crc32.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crc32.py b/crc32.py index a51b761..d469409 100644 --- a/crc32.py +++ b/crc32.py @@ -1,4 +1,5 @@ import argparse +import os import sys import zlib @@ -8,9 +9,9 @@ from voussoirkit import winglob def crc32_argparse(args): files = ( file - for arg in args.source - for pattern in pipeable.input(arg) + for pattern in pipeable.input_many(args.patterns) for file in winglob.glob(pattern) + if os.path.isfile(file) ) for file in files: try: @@ -23,7 +24,7 @@ def crc32_argparse(args): def main(argv): parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument('source', nargs='+') + parser.add_argument('patterns', nargs='+') parser.set_defaults(func=crc32_argparse) args = parser.parse_args(argv)