1414from code42cli .options import format_option
1515from code42cli .options import OrderedGroup
1616from code42cli .options import sdk_options
17+ from code42cli .output_formats import OutputFormat
1718from code42cli .output_formats import OutputFormatter
1819from code42cli .util import format_string_list_to_columns
1920
@@ -75,8 +76,7 @@ def _list(state, format=None):
7576 formatter = OutputFormatter (format , _MATTER_KEYS_MAP )
7677 matters = _get_all_active_matters (state .sdk )
7778 if matters :
78- for output in formatter .get_formatted_output (matters ):
79- echo (output )
79+ formatter .echo_formatted_list (matters )
8080
8181
8282@legal_hold .command ()
@@ -92,11 +92,9 @@ def _list(state, format=None):
9292 is_flag = True ,
9393 help = "View details of the preservation policy associated with the legal hold matter." ,
9494)
95- @format_option
9695@sdk_options ()
97- def show (state , matter_id , include_inactive = False , include_policy = False , format = None ):
96+ def show (state , matter_id , include_inactive = False , include_policy = False ):
9897 """Display details of a given legal hold matter."""
99- formatter = OutputFormatter (format , _MATTER_KEYS_MAP )
10098 matter = _check_matter_is_accessible (state .sdk , matter_id )
10199 matter ["creator_username" ] = matter ["creator" ]["username" ]
102100 matter = json .loads (matter .text )
@@ -114,9 +112,8 @@ def show(state, matter_id, include_inactive=False, include_policy=False, format=
114112 member ["user" ]["username" ] for member in memberships if not member ["active" ]
115113 ]
116114
117- for output in formatter .get_formatted_output ([matter ]):
118- echo (output )
119-
115+ formatter = OutputFormatter (OutputFormat .TABLE , _MATTER_KEYS_MAP )
116+ formatter .echo_formatted_list ([matter ])
120117 _print_matter_members (active_usernames , member_type = "active" )
121118
122119 if include_inactive :
0 commit comments