Skip to content

Commit f4635b5

Browse files
authored
Merge pull request #173 from fosslight/help
Update help message
2 parents 238369f + e29d53a commit f4635b5

File tree

1 file changed

+67
-41
lines changed

1 file changed

+67
-41
lines changed

src/fosslight_prechecker/_help.py

Lines changed: 67 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,73 @@
66

77

88
_HELP_MESSAGE_PRECHECKER = """
9-
FOSSLight Prechecker is a tool that checks whether source code complies with copyright and license writing rules.
10-
11-
Usage: fosslight_prechecker [Mode] [option1] <arg1> [option2] <arg2>...
12-
ex) fosslight_prechecker lint -p /home/test/src/
13-
fosslight_prechecker lint -p /home/test/src/ -e test.py dep/temp
14-
fosslight_prechecker add -p /home/test/test.py -c "2019-2021 LG Electronics Inc." -l "GPL-3.0-only"
15-
fosslight_prechecker convert -p /home/test/sbom_info.yaml
16-
fosslight_prechecker download -l "MIT"
17-
18-
Parameters:
19-
Mode
20-
lint\t\t (Default) Check whether the copyright and license writing rules are complied with
21-
convert\t\t Convert sbom_info.yaml -> FOSSLight-Report.xlsx
22-
add\t\t\t Add missing license, copyright, and download url
23-
download\t\t Download the license text of the license specified in sbom-info.yaml
24-
25-
Options:
26-
-h\t\t\t Print help message
27-
-v\t\t\t Print FOSSLight Prechecker version
28-
-p <path>\t\t Path to check(Default: current directory)
29-
-e <path>\t\t Path to exclude from checking(files and directories, only work with 'lint' mode)
30-
\t\t\t * IMPORTANT: Always wrap patterns in double quotes ("") to avoid shell expansion.
31-
\t\t\t Example) fosslight_prechecker -e "test/abc.py" "*.jar"
32-
-f <format>\t\t Result format(yaml, xml, html)
33-
-o <file_name>\t Output file name
34-
-i\t\t\t Don't both write log file and show progress bar
35-
--notice\t\t Print the open source license notice text.
36-
37-
Option for 'lint' mode
38-
-n\t\t\t Don't exclude venv*, node_modules, .*/, and the result of FOSSLight Scanners from the analysis
39-
40-
Options for 'add' mode
41-
Please enter any argument with double quotation marks("").
42-
-l <license>\t License name(SPDX format) to add(ex, "Apache-2.0")
43-
-c <copyright>\t Copyright to add(ex, "2015-2021 LG Electronics Inc.")
44-
-u <dl_location>\t Download Location to add(ex, "https://github.com/fosslight/fosslight_prechecker")
45-
46-
Options for 'download' mode
47-
Please enter any argument with double quotation marks("").
48-
-l <license>\t License to be representative license
49-
"""
9+
📖 Usage
10+
────────────────────────────────────────────────────────────────────
11+
fosslight_prechecker [mode] [options] <arguments>
12+
13+
📝 Description
14+
────────────────────────────────────────────────────────────────────
15+
FOSSLight Prechecker checks and corrects copyright and license writing
16+
rules in source code. It can lint, add, convert, and
17+
download license information.
18+
19+
📚 Guide: https://fosslight.org/fosslight-guide/scanner/1_prechecker.html
20+
21+
🔧 Modes
22+
────────────────────────────────────────────────────────────────────
23+
lint (default) Check copyright and license writing rules compliance
24+
add Add missing license, copyright, and download location
25+
convert Convert sbom-info.yaml to FOSSLight-Report.xlsx
26+
download Download license text specified in sbom-info.yaml
27+
28+
⚙️ General Options
29+
────────────────────────────────────────────────────────────────────
30+
-p <path> Path to check (default: current directory)
31+
-o <file> Output file name
32+
-f <format> Result format (yaml, xml, html)
33+
-e <pattern> Exclude paths from checking (files and directories)
34+
(only works with 'lint' mode)
35+
⚠️ IMPORTANT: Always wrap in quotes to avoid shell expansion
36+
Example: fosslight_prechecker -e "test/" "*.pyc"
37+
-h Show this help message
38+
-v Show version information
39+
-i Don't write log file and show progress bar
40+
--notice Print the open source license notice text
41+
42+
🔍 Mode-Specific Options
43+
────────────────────────────────────────────────────────────────────
44+
lint mode:
45+
-n Don't exclude venv*, node_modules, .*/, and
46+
FOSSLight Scanner results from analysis
47+
48+
add mode:
49+
-l <license> Add license name in SPDX format (ex: "Apache-2.0")
50+
-c <copyright> Add copyright text (ex: "2015-2021 LG Electronics Inc.")
51+
-u <url> Add download location URL(ex: "https://www.sampleurl.com")
52+
53+
download mode:
54+
-l <license> License to be representative license
55+
56+
💡 Examples
57+
────────────────────────────────────────────────────────────────────
58+
# Lint current directory (check compliance)
59+
fosslight_prechecker lint
60+
61+
# Lint specific path with exclusions
62+
fosslight_prechecker lint -p /path/to/source -e "test/" "node_modules/"
63+
64+
# Add license and copyright to a file
65+
fosslight_prechecker add -p test.py -l "GPL-3.0-only" -c "2019-2021 LG Electronics Inc."
66+
67+
# Add license, copyright, and download location
68+
fosslight_prechecker add -p src/main.py -l "Apache-2.0" -c "2023 MyCompany" -u "https://github.com/user/repo"
69+
70+
# Convert sbom-info.yaml to Excel report
71+
fosslight_prechecker convert -p sbom-info.yaml
72+
73+
# Download license text
74+
fosslight_prechecker download -l "MIT"
75+
"""
5076

5177

5278
def print_help_msg(exitOpt: bool = True) -> None:

0 commit comments

Comments
 (0)