Skip to content

Commit

Permalink
Catch -/-- values passed into CLI for remove-resource/no-remove-resou…
Browse files Browse the repository at this point in the history
…rces (#146)
  • Loading branch information
bsquizz authored Oct 29, 2021
1 parent aafce9a commit d979b87
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bonfire/bonfire.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
Expand Down

0 comments on commit d979b87

Please sign in to comment.