From 0cfcfd2fbabef319223020b876ec07df631e3ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alen=20=C5=A0iljak?= <462445+alensiljak@users.noreply.github.com> Date: Mon, 23 Jun 2025 10:38:47 +0200 Subject: [PATCH 1/2] inform user when no source specified --- beangulp/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/beangulp/__init__.py b/beangulp/__init__.py index eef15a7..3ae0530 100644 --- a/beangulp/__init__.py +++ b/beangulp/__init__.py @@ -196,6 +196,9 @@ def _archive( errors = exceptions.ExceptionsTrap(log) renames = [] + if not src: + log("No source files specified!") + for filename in _walk(src, log): with errors: importer = identify.identify(ctx.importers, filename) From f31ecf2ff89e9d8ba08f9a948addca287d4dfbbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alen=20=C5=A0iljak?= <462445+alensiljak@users.noreply.github.com> Date: Mon, 23 Jun 2025 11:55:19 +0200 Subject: [PATCH 2/2] Handle the case when the parameter is not supplied --- beangulp/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beangulp/__init__.py b/beangulp/__init__.py index 3ae0530..c85e2c5 100644 --- a/beangulp/__init__.py +++ b/beangulp/__init__.py @@ -138,7 +138,7 @@ def _extract( @click.command("archive") -@click.argument("src", nargs=-1, type=click.Path(exists=True, resolve_path=True)) +@click.argument("src", nargs=-1, type=click.Path(exists=True, resolve_path=True), default=None) @click.option( "--destination", "-o", @@ -196,7 +196,7 @@ def _archive( errors = exceptions.ExceptionsTrap(log) renames = [] - if not src: + if src is None: log("No source files specified!") for filename in _walk(src, log):