summaryrefslogtreecommitdiff
path: root/bin/taler-merchant-demos
diff options
context:
space:
mode:
authorMS <ms@taler.net>2020-07-22 15:36:52 +0200
committerMS <ms@taler.net>2020-07-22 15:36:52 +0200
commit4c9812bd177fd7133b5ae8dc1d1f6807985dcd7a (patch)
tree64adfad0878f343df23c1ca759ea7db287780298 /bin/taler-merchant-demos
parent2d97ecc2c1ac605ca49e8a866b309daaeb7a831c (diff)
downloadtaler-merchant-demos-4c9812bd177fd7133b5ae8dc1d1f6807985dcd7a.tar.gz
taler-merchant-demos-4c9812bd177fd7133b5ae8dc1d1f6807985dcd7a.tar.bz2
taler-merchant-demos-4c9812bd177fd7133b5ae8dc1d1f6807985dcd7a.zip
sub-commands not really needed
Diffstat (limited to 'bin/taler-merchant-demos')
-rwxr-xr-xbin/taler-merchant-demos25
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()