18
18
UNITS = tuple [str ](("o" , "ko" , "Mo" , "Go" , "To" ))
19
19
20
20
def helper (commands : tuple ) -> None :
21
- colors = tuple [str ]((Colors .cyan , Colors .yellow , Colors .red ))
22
- screen = list [str ]([ " List of commands:\n " ])
21
+ colors = tuple [str ]((Colors .cyan , Colors .yellow , Colors .red ))
22
+ screen = list [str ]([ " List of commands:\n " ])
23
23
24
24
for i , command in enumerate (commands ):
25
- c = int (1 if (i in range ((len (commands )- 4 ), (len (commands )- 1 ))) else 0 )
26
- c = int (2 if (i in range ((len (commands )- 1 ), (len (commands )))) else c )
27
- sep = str ('\n ' if (i in (len (commands )- 5 , len (commands )- 2 )) else '' )
25
+ c = int (1 if (i in range ((len (commands )- 4 ), (len (commands )- 1 ))) else 0 )
26
+ c = int (2 if (i in range ((len (commands )- 1 ), (len (commands )))) else c )
27
+ sep = str ('\n ' if (i in (len (commands )- 5 , len (commands )- 2 )) else '' )
28
28
29
29
command = str (f" { colors [c ]} { command [1 ]} { Colors .end } { sep } " )
30
30
@@ -45,9 +45,9 @@ def launch(tool: Tool, args: list[str]) -> bool:
45
45
return (True )
46
46
47
47
def sortTools (tools : list [Tool ]) -> list [Tool ]:
48
- print (f"\n { ' ' * 1 } * Name{ ' ' * (12 - len ('Name' ))} Path" )
48
+ print (f"\n { ' ' * 1 } * Name{ ' ' * (12 - len ('Name' ))} Command { ' ' * ( 16 - len ( 'Command' )) } Path" )
49
49
for i , tool in enumerate (tools , start = 1 ):
50
- print (f" { ' ' * (2 - len (str (i )))} { i } . { tool .name } { ' ' * (12 - len (tool .name ))} { tool .path } " , end = "\n " * (2 if (i == len (tools )) else 1 ))
50
+ print (f" { ' ' * (2 - len (str (i )))} { i } . { tool .name } { ' ' * (12 - len (tool .name ))} { tool .command [ 1 ] } { ' ' * ( 16 - len ( tool . command [ 1 ])) } { tool . path } " , end = "\n " * (2 if (i == len (tools )) else 1 ))
51
51
52
52
return (tools )
53
53
0 commit comments