diff --git a/argos/commands.py b/argos/commands.py index 23ae9f1..63b1bd9 100644 --- a/argos/commands.py +++ b/argos/commands.py @@ -92,8 +92,19 @@ def validate_max_lock_seconds(ctx, param, value): return value +def validate_max_results(ctx, param, value): + if value <= 0: + raise click.BadParameter("Should be a positive integer") + return value + + @server.command() -@click.option("--max-results", default=100, help="Number of results per task to keep") +@click.option( + "--max-results", + default=100, + help="Number of results per task to keep", + callback=validate_max_results, +) @click.option( "--max-lock-seconds", default=100,