From bedd37c59022b327d3d752f55d600ba19b4501b4 Mon Sep 17 00:00:00 2001 From: Flancian <0@flancia.org> Date: Sun, 24 Sep 2023 20:32:47 +0200 Subject: [PATCH] autopushed --- bin/primes.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bin/primes.py b/bin/primes.py index 0e63b3440..f8f671dc6 100755 --- a/bin/primes.py +++ b/bin/primes.py @@ -47,6 +47,19 @@ class AgoraCmd(click.Command): - Visit anagora.org/foo/1 to execute e.g. , from your garden.") """) + def __call__(self, *args, **kwargs): + try: + return super(ShowUsageOnMissingError, self).__call__( + *args, standalone_mode=False, **kwargs) + except click.MissingParameter as exc: + exc.ctx = None + exc.show(file=sys.stdout) + click.echo() + try: + super(ShowUsageOnMissingError, self).__call__(['--help']) + except SystemExit: + sys.exit(exc.exit_code) + @click.command(cls=AgoraCmd) @click.argument('n', type=click.INT) def prime(n):