Skip to content

Commit a354411

Browse files
committed
WIP styling disagreements
1 parent 9853e4c commit a354411

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

bittensor_cli/cli.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,9 +1389,16 @@ def build_rich_tree(data: dict, parent: Tree):
13891389
group_node = parent.add(
13901390
f"{arg__(group.name)}: {group.short_help}"
13911391
) # Add group to the tree
1392+
max_command_length = max(
1393+
(len(command.name) for command in content.get("commands", [])),
1394+
default=0
1395+
)
1396+
13921397
for command in content.get("commands", []):
1398+
spaces_needed = max_command_length - len(command.name)
1399+
padding = " " * spaces_needed
13931400
group_node.add(
1394-
f"[green]{command.name}[/]: [dim]{command.short_help}[/dim]"
1401+
f"[green]{command.name}[/]:{padding}\t[dim]{command.short_help}[/dim]"
13951402
) # Add commands to the group
13961403
build_rich_tree(content, group_node) # Recurse for subgroups
13971404

0 commit comments

Comments
 (0)