Merge pull request 'clan: add more machine completion functions to secrets' (#1552) from kenji/clan-core:add/completion/secret-subcommands into main

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/1552
This commit is contained in:
kenji
2024-06-04 09:30:02 +00:00

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,