add shell complete
This commit is contained in:
parent
1f28369805
commit
1b4daa0d71
1 changed files with 5 additions and 2 deletions
|
@ -252,8 +252,11 @@ def new(ctx):
|
||||||
ctx.invoke(reload)
|
ctx.invoke(reload)
|
||||||
|
|
||||||
|
|
||||||
|
def shell_complete_service(ctx, param, incomplete):
|
||||||
|
return [file.name for file in certs.get_site_files(NGINX_DIR) if incomplete in file.name]
|
||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@click.argument("service")
|
@click.argument("service", shell_complete=shell_complete_service)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def edit(ctx, service: str):
|
def edit(ctx, service: str):
|
||||||
"""Edit a service"""
|
"""Edit a service"""
|
||||||
|
@ -287,7 +290,7 @@ def edit(ctx, service: str):
|
||||||
|
|
||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@click.argument("service")
|
@click.argument("service", shell_complete=shell_complete_service)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def delete(ctx, service: str):
|
def delete(ctx, service: str):
|
||||||
"""Delete a service"""
|
"""Delete a service"""
|
||||||
|
|
Loading…
Reference in a new issue