mirror of
https://github.com/flancian/garden.git
synced 2026-08-07 06:56:19 +00:00
autopushed
This commit is contained in:
@@ -47,6 +47,19 @@ class AgoraCmd(click.Command):
|
||||
- Visit anagora.org/foo/1 to execute e.g. <bin/foo.py 1>, <exec/foo.py 1> 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):
|
||||
|
||||
Reference in New Issue
Block a user