File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments