From 3097807b05942b04a8cfb40b527adc7dac9b63cb Mon Sep 17 00:00:00 2001 From: jpk Date: Tue, 10 Jan 2023 15:19:16 +0100 Subject: [PATCH] Edit docker-compose file of a service --- doxy/cli.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doxy/cli.py b/doxy/cli.py index 49a4a1c..f2a51e2 100644 --- a/doxy/cli.py +++ b/doxy/cli.py @@ -32,6 +32,14 @@ def complete_service_name(ctx, param, incomplete): return [k for k in services.find_services(Path(config.root_directory)) if k.startswith(incomplete)] +@click.command() +@click.argument("service", nargs=1, shell_complete=complete_service_name) +@click.pass_context +def edit(ctx, service): + compose_file = services.get_compose_file(Path(ctx.obj["CONFIG"].root_directory) / service) + click.edit(filename=Path(compose_file)) + + @click.command() @click.pass_context @click.argument("service", nargs=1, shell_complete=complete_service_name) @@ -42,4 +50,5 @@ def control(ctx, service, command): main.add_command(list) +main.add_command(edit) main.add_command(control)