99
1010import requests
1111import yaml
12- from terminaltables import SingleTable
12+ from rich import print as rprint
13+ from rich .table import Table
1314
1415from linodecli import plugins
1516
@@ -233,23 +234,26 @@ def help_with_ops(ops, config):
233234 # commands to manage CLI users (don't call out to API)
234235 print ("\n CLI user management commands:" )
235236 um_commands = [["configure" , "set-user" , "show-users" ], ["remove-user" ]]
236- table = SingleTable (um_commands )
237- table .inner_heading_row_border = False
238- print (table .table )
237+ table = Table (show_header = False )
238+ for cmd in um_commands :
239+ table .add_row (* cmd )
240+ rprint (table )
239241
240242 # commands to manage plugins (don't call out to API)
241243 print ("\n CLI Plugin management commands:" )
242244 pm_commands = [["register-plugin" , "remove-plugin" ]]
243- table = SingleTable (pm_commands )
244- table .inner_heading_row_border = False
245- print (table .table )
245+ table = Table (show_header = False )
246+ for cmd in pm_commands :
247+ table .add_row (* cmd )
248+ rprint (table )
246249
247250 # other CLI commands
248251 print ("\n Other CLI commands:" )
249252 other_commands = [["completion" ]]
250- table = SingleTable (other_commands )
251- table .inner_heading_row_border = False
252- print (table .table )
253+ table = Table (show_header = False )
254+ for cmd in other_commands :
255+ table .add_row (* cmd )
256+ rprint (table )
253257
254258 # commands generated from the spec (call the API directly)
255259 print ("\n Available commands:" )
@@ -261,9 +265,10 @@ def help_with_ops(ops, config):
261265 if content [i + 3 :]:
262266 proc .append (content [i + 3 :])
263267
264- table = SingleTable (proc )
265- table .inner_heading_row_border = False
266- print (table .table )
268+ table = Table (show_header = False )
269+ for cmd in proc :
270+ table .add_row (* cmd )
271+ rprint (table )
267272
268273 # plugins registered to the CLI (do arbitrary things)
269274 if plugins .available (config ):
@@ -278,10 +283,10 @@ def help_with_ops(ops, config):
278283 if plugin_content [i + 3 :]:
279284 plugin_proc .append (plugin_content [i + 3 :])
280285
281- plugin_table = SingleTable ( plugin_proc )
282- plugin_table . inner_heading_row_border = False
283-
284- print (plugin_table . table )
286+ plugin_table = Table ( show_header = False )
287+ for plugin in plugin_proc :
288+ plugin_table . add_row ( * plugin )
289+ rprint (plugin_table )
285290
286291 print ("\n To reconfigure, call `linode-cli configure`" )
287292 print (
0 commit comments