diff options
Diffstat (limited to 'bin/taler-merchant-demos')
-rwxr-xr-x | bin/taler-merchant-demos | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/bin/taler-merchant-demos b/bin/taler-merchant-demos index 42fe35a..8f8df21 100755 --- a/bin/taler-merchant-demos +++ b/bin/taler-merchant-demos @@ -77,26 +77,19 @@ def handle_serve_http(config, whichShop, port=None): "--http", spec, "--module", "talermerchantdemos.{}:app".format(whichShop)) -@click.group(help="Global launcher of Taler demo stores") +@click.command() @click.option("--config", help="Configuration file", required=False) -@click.pass_context -def cli(ctx, config): - if config: - os.environ["TALER_CONFIG_FILE"] = config - config_obj = TalerConfig.from_file(os.environ.get("TALER_CONFIG_FILE")) - ctx.obj = dict(config=config_obj) - -@cli.command(help="Run the blog") -@click.pass_obj @click.option("--serve-http", help="Serve via HTTP", is_flag=True, required=False) @click.option("--port", help="HTTP port to serve (if not given, it's picked from config)", required=False, type=int) @click.option("--serve-uwsgi", help="Serve via UWSGI (default)", required=False) -def blog(obj, serve_http, port, serve_uwsgi): - assert(obj.get("config")) - +@click.argument("whichShop") +def demos(config, serve_http, port, serve_uwsgi, whichShop): + if config: + os.environ["TALER_CONFIG_FILE"] = config + config_obj = TalerConfig.from_file(os.environ.get("TALER_CONFIG_FILE")) if serve_http: # port was given - handle_serve_http(obj["config"], "blog", port) + handle_serve_http(config_obj, whichShop, port) return - handle_serve_uwsgi(obj["config"], "blog") + handle_serve_uwsgi(config_obj, whichShop) -cli() +demos() |