clan: add more machine completion functions to secrets

This commit is contained in:
a-kenji
2024-06-04 11:07:24 +02:00
parent 8a8a6170ca
commit 9b6a9f0515

View File

@@ -9,7 +9,7 @@ from pathlib import Path
from typing import IO from typing import IO
from .. import tty from .. import tty
from ..completions import add_dynamic_completer, complete_secrets from ..completions import add_dynamic_completer, complete_machines, complete_secrets
from ..errors import ClanError from ..errors import ClanError
from ..git import commit_files from ..git import commit_files
from .folders import ( from .folders import (
@@ -340,13 +340,14 @@ def register_secrets_parser(subparser: argparse._SubParsersAction) -> None:
default=[], default=[],
help="the group to import the secrets to (can be repeated)", help="the group to import the secrets to (can be repeated)",
) )
parser_set.add_argument( machine_parser = parser_set.add_argument(
"--machine", "--machine",
type=str, type=str,
action="append", action="append",
default=[], default=[],
help="the machine to import the secrets to (can be repeated)", help="the machine to import the secrets to (can be repeated)",
) )
add_dynamic_completer(machine_parser, complete_machines)
parser_set.add_argument( parser_set.add_argument(
"--user", "--user",
type=str, type=str,