3131 "(e.g. 'https')" ,
3232}
3333
34+ HELP_TOPICS = {
35+ "env-vars" : "Environment variables that can be used" ,
36+ "commands" : "Learn about all available commands with linode-cli" ,
37+ "plugins" : " Learn about all available plugins registered to linode-cli" ,
38+ }
3439
35- # pylint: disable=too-many-locals
36- def print_help_default (ops , config ):
37- """
38- Prints help output with options from the API spec
40+
41+ def print_help_env_vars ():
3942 """
43+ Print Environment variables overrides. Usage:
4044
41- # Environment variables overrides
42- print ("\n Environment variables:" )
45+ linode-cli env-vars
46+ """
47+ rprint ("\n [bold cyan]Environment variables:" )
4348
44- table = Table (show_header = True , header_style = "" , box = box .SQUARE )
49+ table = Table (show_header = True , header_style = "bold " , box = box .SQUARE )
4550 table .add_column ("Name" )
4651 table .add_column ("Description" )
4752
@@ -50,32 +55,39 @@ def print_help_default(ops, config):
5055
5156 rprint (table )
5257
58+
59+ def print_help_commands (ops ):
60+ """
61+ Prints available commands. Usage:
62+
63+ linode-cli commands
64+ """
5365 # commands to manage CLI users (don't call out to API)
54- print ("\n CLI user management commands:" )
66+ rprint ("\n [bold cyan]CLI user management commands:" )
5567 um_commands = [["configure" , "set-user" , "show-users" ], ["remove-user" ]]
5668 table = Table (show_header = False )
5769 for cmd in um_commands :
5870 table .add_row (* cmd )
5971 rprint (table )
6072
6173 # commands to manage plugins (don't call out to API)
62- print ("\n CLI Plugin management commands:" )
74+ rprint ("\n [bold cyan]CLI Plugin management commands:" )
6375 pm_commands = [["register-plugin" , "remove-plugin" ]]
6476 table = Table (show_header = False )
6577 for cmd in pm_commands :
6678 table .add_row (* cmd )
6779 rprint (table )
6880
6981 # other CLI commands
70- print ("\n Other CLI commands:" )
82+ rprint ("\n [bold cyan]Other CLI commands:" )
7183 other_commands = [["completion" ]]
7284 table = Table (show_header = False )
7385 for cmd in other_commands :
7486 table .add_row (* cmd )
7587 rprint (table )
7688
7789 # commands generated from the spec (call the API directly)
78- print ("\n Available commands:" )
90+ rprint ("\n [bold cyan]Available commands:" )
7991
8092 content = list (sorted (ops .keys ()))
8193 proc = []
@@ -89,10 +101,16 @@ def print_help_default(ops, config):
89101 table .add_row (* cmd )
90102 rprint (table )
91103
92- # plugins registered to the CLI (do arbitrary things)
104+
105+ def print_help_plugins (config ):
106+ """
107+ Print available plugins registered to the CLI (do arbitrary things). Usage:
108+
109+ linode-cli plugins
110+ """
93111 if plugins .available (config ):
94112 # only show this if there are any available plugins
95- print ( " Available plugins:" )
113+ rprint ( " \n [bold cyan] Available plugins:" )
96114
97115 plugin_content = list (plugins .available (config ))
98116 plugin_proc = []
@@ -107,7 +125,15 @@ def print_help_default(ops, config):
107125 plugin_table .add_row (* plugin )
108126 rprint (plugin_table )
109127
110- print ("\n To reconfigure, call `linode-cli configure`" )
128+
129+ def print_help_default ():
130+ """
131+ Prints help output with options from the API spec
132+ """
133+ rprint ("\n [bold cyan]Help Topics" )
134+ for k , v in HELP_TOPICS .items ():
135+ print (" " + k + ": " + v )
136+ rprint ("\n [bold]To reconfigure[/], call `linode-cli configure`" )
111137 print (
112138 "For comprehensive documentation, "
113139 "visit https://www.linode.com/docs/api/"
@@ -134,11 +160,11 @@ def print_help_action(
134160 console .print (f" [{ pname } ]" , end = "" )
135161
136162 console .print ()
137- console .print (f"[bold ]{ op .summary } [/]" )
163+ console .print (f"[cyan ]{ op .summary } [/]" )
138164
139165 if op .docs_url :
140166 console .print (
141- f"[bold]API Documentation: [link={ op .docs_url } ]{ op .docs_url } [/link][/ ]"
167+ f"[bold]API Documentation[/] : [link={ op .docs_url } ]{ op .docs_url } [/link]"
142168 )
143169
144170 if len (op .samples ) > 0 :
0 commit comments