diff --git a/hostapps/run.py b/hostapps/run.py index 88c888c..4d881b7 100644 --- a/hostapps/run.py +++ b/hostapps/run.py @@ -62,20 +62,12 @@ Config = TypeAdapter(dict[str, Entry]) @click.option("--ssh-command", default="ssh") @click.option("--telnet-command", default="telnet") @click.option("--config", type=click.Path(exists=True, path_type=pathlib.Path)) -@click.option("--name", type=str) def main( ssh_command: str, telnet_command: str, config: pathlib.Path, - name: str, ): - cfg = Config.validate_json(config.read_bytes()) - - if name not in cfg: - sys.stderr.write("unknown config entry!\n") - sys.exit(1) - - entry = cfg[name] + entry = Entry.validate_model_json(config.read_bytes()) a = pyansi.ANSI() sys.stdout.write(a.Title(text=f"{entry.name} - {entry.address}"))