mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-16 05:49:59 -05:00
fix: align component prompt regardless of digits
This commit is contained in:
@@ -124,8 +124,9 @@ class Command:
|
|||||||
return
|
return
|
||||||
|
|
||||||
print(format_msg(PROMPT_COLOUR, "Components to enable?"))
|
print(format_msg(PROMPT_COLOUR, "Components to enable?"))
|
||||||
|
max_idx_w = len(str(len(comp_arr)))
|
||||||
for i, comp in enumerate(comp_arr):
|
for i, comp in enumerate(comp_arr):
|
||||||
print(format_msg(PROMPT_COLOUR, f" [{i + 1}] {comp}"))
|
print(format_msg(PROMPT_COLOUR, f" {i + 1:<{max_idx_w}}\t{comp}"))
|
||||||
print(format_msg(PROMPT_COLOUR, "[A]ll or (1 2 3, 1-3, ^4)"))
|
print(format_msg(PROMPT_COLOUR, "[A]ll or (1 2 3, 1-3, ^4)"))
|
||||||
ans = prompt("", end="").lower().strip()
|
ans = prompt("", end="").lower().strip()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user