Ben
91a0edda5b
Caveats: UI hangs while selecting recipes No calculation is done based on input resource flow
14 lines
327 B
Python
14 lines
327 B
Python
import click
|
|
|
|
|
|
def prompt(options: dict[int, str], **kwargs) -> int | None:
|
|
for idx, label in options.items():
|
|
if label:
|
|
click.echo(f"{idx}: {label}")
|
|
ret = click.prompt(**kwargs)
|
|
ret = int(ret)
|
|
if ret not in options:
|
|
click.echo("Invalid choice.")
|
|
return None
|
|
return ret
|