diff --git a/quicktex/cli/common.py b/quicktex/cli/common.py index 7c62897..5beea0d 100644 --- a/quicktex/cli/common.py +++ b/quicktex/cli/common.py @@ -40,7 +40,7 @@ def path_pairs(inputs, output, suffix, extension): """ if len(inputs) < 1: - raise click.BadArgumentUsage('No input files were provided.') + raise click.BadArgumentUsage('No valid input files were provided.') inpaths = [pathlib.Path(i) for i in inputs] diff --git a/quicktex/cli/encode.py b/quicktex/cli/encode.py index 0aa3e33..fee90fd 100644 --- a/quicktex/cli/encode.py +++ b/quicktex/cli/encode.py @@ -37,6 +37,7 @@ def encode(): ) @click.argument('filenames', nargs=-1, type=click.Path(exists=True, readable=True, dir_okay=False)) def encode_format(encoder, four_cc, flip, remove, suffix, output, filenames, swizzle=False): + filenames = [f for f in filenames if not f.endswith('.dds')] path_pairs = common.path_pairs(filenames, output, suffix, '.dds') with click.progressbar( @@ -112,8 +113,11 @@ def encode_auto(level, black, threecolor, flip, remove, suffix, output, filename bc1_encoder = quicktex.s3tc.bc1.BC1Encoder(level, mode) bc3_encoder = quicktex.s3tc.bc3.BC3Encoder(level) + filenames = [f for f in filenames if not f.endswith('.dds')] path_pairs = common.path_pairs(filenames, output, suffix, '.dds') + assert len(filenames) > 0 + with click.progressbar( path_pairs, show_eta=False, show_pos=True, item_show_func=lambda x: str(x[0]) if x else '' ) as bar: