forked from clan/clan-core
clan: add dynamic completions to clan vms run
This commit is contained in:
parent
05ff7bd261
commit
21ac1f7204
@ -7,6 +7,7 @@ from contextlib import ExitStack
|
||||
from pathlib import Path
|
||||
from tempfile import TemporaryDirectory
|
||||
|
||||
from ..completions import add_dynamic_completer, complete_machines
|
||||
from ..cmd import Log, run
|
||||
from ..dirs import module_root, user_cache_dir, vm_state_dir
|
||||
from ..errors import ClanError
|
||||
@ -205,5 +206,8 @@ def run_command(
|
||||
|
||||
|
||||
def register_run_parser(parser: argparse.ArgumentParser) -> None:
|
||||
parser.add_argument("machine", type=str, help="machine in the flake to run")
|
||||
machine_action = parser.add_argument(
|
||||
"machine", type=str, help="machine in the flake to run"
|
||||
)
|
||||
add_dynamic_completer(machine_action, complete_machines)
|
||||
parser.set_defaults(func=lambda args: run_command(**args.__dict__))
|
||||
|
Loading…
Reference in New Issue
Block a user