From f7077e35407e883b7b5b57a5a37357a721fa25f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 3 Apr 2024 11:51:21 +0200 Subject: [PATCH] flash: improve prompt if no disk is specified --- pkgs/clan-cli/clan_cli/flash.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/clan-cli/clan_cli/flash.py b/pkgs/clan-cli/clan_cli/flash.py index 94a91368..e59d2102 100644 --- a/pkgs/clan-cli/clan_cli/flash.py +++ b/pkgs/clan-cli/clan_cli/flash.py @@ -103,7 +103,11 @@ def flash_command(args: argparse.Namespace) -> None: machine = Machine(opts.machine, flake=opts.flake) if opts.confirm and not opts.dry_run: disk_str = ", ".join(f"{name}={device}" for name, device in opts.disks.items()) - ask = input(f"Install {machine.name} to {disk_str}? [y/N] ") + msg = f"Install {machine.name}" + if disk_str != "": + msg += f" to {disk_str}" + msg += "? [y/N] " + ask = input(msg) if ask != "y": return flash_machine(machine, disks=opts.disks, dry_run=opts.dry_run, debug=opts.debug)