Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print option name with error msg #132

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/fosslight_scanner/fosslight_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def run_main(mode_list, path_arg, dep_arguments, output_file_or_dir, file_format
before_comp_f = path_arg[0]
after_comp_f = path_arg[1]
else:
logger.error("Enter two FOSSLight report file with 'p' option.")
logger.error("(compare mode) Enter two FOSSLight report file with 'p' option.")
return False
else:
CUSTOMIZED_FORMAT = {}
Expand All @@ -405,7 +405,7 @@ def run_main(mode_list, path_arg, dep_arguments, output_file_or_dir, file_format
extract_folder = src_path
break
else:
logger.warning(f"Cannot analyze with multiple path: {path_arg}")
logger.warning(f"(-p option) Cannot analyze with multiple path: {path_arg}")

success, msg, output_path, output_files, output_extensions, formats = check_output_formats_v2(output_file_or_dir, file_format,
CUSTOMIZED_FORMAT)
Expand All @@ -420,13 +420,13 @@ def run_main(mode_list, path_arg, dep_arguments, output_file_or_dir, file_format
try:
if "compare" in mode_list:
if before_comp_f == '' or after_comp_f == '':
logger.error("before and after files are necessary.")
logger.error("(compare mode) before and after files are necessary.")
return False
if not os.path.exists(os.path.join(_executed_path, before_comp_f)):
logger.error("Cannot find before FOSSLight report file (1st param with -y option).")
logger.error("(compare mode) Cannot find before FOSSLight report file (1st param with -y option).")
return False
if not os.path.exists(os.path.join(_executed_path, after_comp_f)):
logger.error("Cannot find after FOSSLight report file (2nd param with -y option).")
logger.error("(compare mode) Cannot find after FOSSLight report file (2nd param with -y option).")
return False
ret, final_excel_dir, result_log = init(output_path)

Expand Down Expand Up @@ -482,7 +482,7 @@ def run_main(mode_list, path_arg, dep_arguments, output_file_or_dir, file_format
if extract_folder:
shutil.rmtree(extract_folder)
else:
logger.error("No mode has been selected for analysis.")
logger.error("(mode) No mode has been selected for analysis.")
try:
if not keep_raw_data:
logger.debug(f"Remove temporary files: {_output_dir}")
Expand Down
Loading