diff --git a/nginx_configurator/main.py b/nginx_configurator/main.py index 3ae203a..5e06b48 100644 --- a/nginx_configurator/main.py +++ b/nginx_configurator/main.py @@ -252,8 +252,11 @@ def new(ctx): 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() -@click.argument("service") +@click.argument("service", shell_complete=shell_complete_service) @click.pass_context def edit(ctx, service: str): """Edit a service""" @@ -287,7 +290,7 @@ def edit(ctx, service: str): @cli.command() -@click.argument("service") +@click.argument("service", shell_complete=shell_complete_service) @click.pass_context def delete(ctx, service: str): """Delete a service"""