From d979b870f7fb1f9cd945b7638a9d606ce4aee04f Mon Sep 17 00:00:00 2001 From: Brandon Squizzato <35474886+bsquizz@users.noreply.github.com> Date: Fri, 29 Oct 2021 15:09:07 -0400 Subject: [PATCH] Catch -/-- values passed into CLI for remove-resource/no-remove-resources (#146) --- bonfire/bonfire.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bonfire/bonfire.py b/bonfire/bonfire.py index d92a51c8..e7ebb8e8 100755 --- a/bonfire/bonfire.py +++ b/bonfire/bonfire.py @@ -284,6 +284,10 @@ def _validate_resource_arguments(ctx, param, value): "remove_resources": "no_remove_resources", "no_remove_resources": "remove_resources", } + if any([val.startswith("-") for val in value]): + raise click.BadParameter( + "--remove-resources/--no-remove-resources requires a component name or keyword 'all'" + ) if "all" in value and "all" in ctx.params.get(opposite_option[param.name], {}): raise click.BadParameter( "--remove-resources and --no-remove-resources can't be both set to 'all'"