From e8241fb7c90b88e1be47d0e867ecd9aaa0ddfaa2 Mon Sep 17 00:00:00 2001 From: a-kenji Date: Mon, 3 Jun 2024 17:06:03 +0200 Subject: [PATCH] clan: add dynamic completion to `clan machines show` --- pkgs/clan-cli/clan_cli/machines/show.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/clan-cli/clan_cli/machines/show.py b/pkgs/clan-cli/clan_cli/machines/show.py index 51561caa..5909f1b0 100644 --- a/pkgs/clan-cli/clan_cli/machines/show.py +++ b/pkgs/clan-cli/clan_cli/machines/show.py @@ -7,6 +7,7 @@ from pathlib import Path from clan_cli.api import API from ..cmd import run_no_stdout +from ..completions import add_dynamic_completer, complete_machines from ..nix import nix_config, nix_eval from .types import machine_name_type @@ -53,6 +54,7 @@ def show_command(args: argparse.Namespace) -> None: def register_show_parser(parser: argparse.ArgumentParser) -> None: parser.set_defaults(func=show_command) - parser.add_argument( + machine_parser = parser.add_argument( "machine", help="the name of the machine", type=machine_name_type ) + add_dynamic_completer(machine_parser, complete_machines)