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)