@@ -57,26 +57,25 @@ def main():
5757 results = SubTrackingAnalyzer (tracking_file , sub_tracking_file ).sub_tracking_results ()
5858 _process_output (output_format , results , output )
5959 elif args ['combine' ]:
60- directory = None
61- files = None
6260 files = args ['-p' ]
6361 if len (files ) == 1 :
6462 [directory ] = files
6563 files = [os .path .join (directory , file ) for file in os .listdir (directory )]
6664 SubTrackingAnalyzer (None , args ['--stf' ]).combine_sub_tracking_files (files )
67- elif args [ 'compare' ] :
65+ else :
6866 if args ['--cconfig' ] is not None :
6967 with open (args ['--cconfig' ], 'r' ) as file :
7068 config = json .load (file )
71- file_path_map = config ['file_path_map' ] if 'file_path_map' in config else None
69+ file_path_map = config ['file_path_map' ] if 'file_path_map' in config else dict [ str , str ]()
7270 statistic = config ['statistic' ] if 'statistic' in config else None
7371 else :
7472 file_path_map = dict [str , str ]()
7573 statistic = None
76- if not file_path_map and args ['-m' ] is None :
77- raise ValueError (
78- f 'A mapping of tracking session name to file path must be provided either through the -m option or a config file.'
74+ if not file_path_map and not args ['-m' ]:
75+ log . error (
76+ 'A mapping of tracking session name to file path must be provided either through the -m option or a config file.'
7977 )
78+ sys .exit (1 )
8079 else :
8180 file_path_map .update ({name : file for [name , file ] in [option .split ('=' ) for option in args ['-m' ]]})
8281 if args ['--stat' ] is not None :
@@ -154,5 +153,5 @@ def _process_output(output_format: str, output_obj, output: str | None):
154153 file .write (output_str )
155154
156155
157- if __name__ == '__main__' :
158- main ()
156+ if __name__ == '__main__' : # pragma: nocover
157+ main () # pragma: nocover
0 commit comments