From 8e8858933cd1f3462b590771de10f18c1099434c Mon Sep 17 00:00:00 2001 From: Ben Gosney Date: Sat, 24 Dec 2022 12:14:24 +0000 Subject: [PATCH] Allow wildcards in skip argument --- db_to_sqlite/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db_to_sqlite/cli.py b/db_to_sqlite/cli.py index cdb3037..c8cc3ca 100644 --- a/db_to_sqlite/cli.py +++ b/db_to_sqlite/cli.py @@ -3,6 +3,7 @@ import click from sqlalchemy import create_engine, inspect from sqlite_utils import Database +from fnmatch import fnmatch @click.command() @@ -83,7 +84,7 @@ def cli( for i, table in enumerate(tables): if progress: click.echo("{}/{}: {}".format(i + 1, len(tables), table), err=True) - if table in skip: + if any(fnmatch(table, pattern) for pattern in skip): if progress: click.echo(" ... skipping", err=True) continue