def init():
"""Return top level command handler."""
@click.command()
@click.option('--api', required=False, help='API url to use.',
envvar='TREADMILL_RESTAPI')
@click.option('-m', '--manifest', help='App manifest file (stream)',
type=click.Path(exists=True, readable=True))
@click.option('--delete', help='Delete the app.',
is_flag=True, default=False)
@click.argument('appname', required=False)
@cli.handle_exceptions(restclient.CLI_REST_EXCEPTIONS)
def configure(api, manifest, delete, appname):
"""Configure a Treadmill app"""
restapi = context.GLOBAL.admin_api(api)
if appname:
if delete:
return _delete(restapi, appname)
return _configure(restapi, manifest, appname)
else:
return _list(restapi)
return configure
评论列表
文章目录