From a6f44fd6bdb8ef8d912bbff3ede1dd48d881340a Mon Sep 17 00:00:00 2001 From: a-kenji Date: Fri, 8 Nov 2024 14:23:11 +0100 Subject: [PATCH] pkgs/cli: Fix dynamic completions for `update-hardware-config` and it's flags Fix dynamic completions for `update-hardware-config` and it's flags. Now `update-hardware-config` correctly suggests machines as well as for example `--backend` suggests correctly their respective flags. --- pkgs/clan-cli/clan_cli/machines/hardware.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/machines/hardware.py b/pkgs/clan-cli/clan_cli/machines/hardware.py index e1cea0ff4..ebafbe8e2 100644 --- a/pkgs/clan-cli/clan_cli/machines/hardware.py +++ b/pkgs/clan-cli/clan_cli/machines/hardware.py @@ -220,22 +220,22 @@ def register_update_hardware_config(parser: argparse.ArgumentParser) -> None: help="the name of the machine", type=machine_name_type, ) - machine_parser = parser.add_argument( + add_dynamic_completer(machine_parser, complete_machines) + parser.add_argument( "target_host", type=str, nargs="?", help="ssh address to install to in the form of user@host:2222", ) - machine_parser = parser.add_argument( + parser.add_argument( "--password", help="Pre-provided password the cli will prompt otherwise if needed.", type=str, required=False, ) - machine_parser = parser.add_argument( + parser.add_argument( "--backend", help="The type of hardware report to generate.", choices=["nixos-generate-config", "nixos-facter"], default="nixos-generate-config", ) - add_dynamic_completer(machine_parser, complete_machines)