2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-12 00:06:36 +00:00

fix: remove unnecessary - commands aliases

This commit is contained in:
Gavin D'souza 2020-02-18 10:56:37 +05:30
parent 214a2093eb
commit e4355001e7

View File

@ -9,17 +9,7 @@ from bench.config.common_site_config import update_config, get_config, put_confi
import click import click
@click.group(help='Change bench configuration')
class AliasedGroup(click.Group):
def get_command(self, ctx, cmd_name):
try:
cmd_name = ALIASES[cmd_name].name
except KeyError:
pass
return super(AliasedGroup, self).get_command(ctx, cmd_name)
@click.group(cls=AliasedGroup, help='Change bench configuration')
def config(): def config():
pass pass
@ -130,6 +120,3 @@ config.add_command(config_serve_default_site)
config.add_command(config_http_timeout) config.add_command(config_http_timeout)
config.add_command(set_common_config) config.add_command(set_common_config)
config.add_command(remove_common_config) config.add_command(remove_common_config)
# aliases for _ seperated commands to - ones
ALIASES = {k.replace('_', '-'):v for k, v in config.commands.items() if '_' in k}