Skip to content

Commit df14a29

Browse files
committed
Update Help Message
1 parent 5de6ffc commit df14a29

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

src/fosslight_source/help.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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)

src/fosslight_source/run_scancode.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,14 @@
1919
from fosslight_util.timer_thread import TimerThread
2020
from ._parsing_scancode_file_item import parsing_file_item
2121
from fosslight_util.write_excel import write_excel_and_csv
22+
from .help import print_help_msg
2223

2324
logger = logging.getLogger(constant.LOGGER_NAME)
2425
warnings.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-
3530
def main():
3631
argv = sys.argv[1:]
3732
_path_to_scan = ""

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ setenv =
1212
PYTHONPATH=.
1313

1414
commands =
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

0 commit comments

Comments
 (0)