File tree Expand file tree Collapse file tree 3 files changed +28
-6
lines changed Expand file tree Collapse file tree 3 files changed +28
-6
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+ # -*- coding: utf-8 -*-
3+ # Copyright (c) 2021 LG Electronics Inc.
4+ # SPDX-License-Identifier: Apache-2.0
5+ from fosslight_util .help import PrintHelpMsg
6+
7+ _HELP_MESSAGE_SOURCE = """
8+ Usage: fosslight_source [option1] <arg1> [option2] <arg2>...
9+
10+ FOSSLight Source uses ScanCode, a source code scanner, to detect the copyright and license phrases contained in the file.
11+ Some files (ex- build script), binary files, directory and files in specific directories (ex-test) are excluded from the result.
12+ And removes words such as “-only” and “-old-style” from the license name to be printed. The output result is generated in Excel format.
13+
14+ Options:
15+ Mandatory
16+ -p <source_path>\t \t Path to analyze source
17+
18+ Optional
19+ -h\t \t \t \t Print help message
20+ -j\t \t \t \t Generate additional result of executing ScanCode in json format
21+ -o <file_name>\t \t Output file name"""
22+
23+
24+ def print_help_msg ():
25+ helpMsg = PrintHelpMsg (_HELP_MESSAGE_SOURCE )
26+ helpMsg .print_help_msg (True )
Original file line number Diff line number Diff line change 1919from fosslight_util .timer_thread import TimerThread
2020from ._parsing_scancode_file_item import parsing_file_item
2121from fosslight_util .write_excel import write_excel_and_csv
22+ from .help import print_help_msg
2223
2324logger = logging .getLogger (constant .LOGGER_NAME )
2425warnings .filterwarnings ("ignore" , category = FutureWarning )
2526_PKG_NAME = "fosslight_source"
2627_ERROR_PREFIX = "* Error : "
2728
2829
29- def print_help_msg ():
30- print ("* Required : -p path_to_scan" )
31- print ("* Optional : -j " )
32- sys .exit ()
33-
34-
3530def main ():
3631 argv = sys .argv [1 :]
3732 _path_to_scan = ""
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ setenv =
1212 PYTHONPATH =.
1313
1414commands =
15+ fosslight_source -h
1516 fosslight_source -p test -j -o test_scan/scan_result
1617 cat test_scan/scan_result.csv
1718 fosslight_convert -p test_scan/scan_result.json -o test_convert/convert_result
You can’t perform that action at this time.
0 commit comments