|
6 | 6 | from fosslight_util.output_format import SUPPORT_FORMAT |
7 | 7 |
|
8 | 8 | _HELP_MESSAGE_SCANNER = f""" |
9 | | - FOSSLight Scanner performs open source analysis after downloading the source from URL that can be cloned by git or wget. |
10 | | - Instead, open source analysis and checking copyright/license rules can be performed for the local source path. |
11 | | - The output result is generated in OSS Report format. |
12 | | -
|
13 | | - Usage: fosslight [Mode] [option1] <arg1> [option2] <arg2>... |
14 | | -
|
15 | | - Parameters: |
16 | | - Mode: Multiple modes can be entered by separating them with , (ex. source,binary) |
17 | | - all\t\t\t Run all scanners(Default) |
18 | | - source\t\t Run FOSSLight Source Scanner |
19 | | - dependency\t\t Run FOSSLight Dependency Scanner |
20 | | - binary\t\t Run FOSSLight Binary Scanner |
21 | | - compare\t\t Compare two FOSSLight reports |
22 | | -
|
23 | | - Options: |
24 | | - -h\t\t\t Print help message |
25 | | - -p <path>\t\t Path to analyze (ex, -p [input_path]) |
26 | | - * Compare mode input file: Two FOSSLight reports (supports excel, yaml) |
27 | | - (ex, -p [before_name].xlsx [after_name].xlsx) |
28 | | - -w <link>\t\t Link to be analyzed can be downloaded by wget or git clone |
29 | | - -f <formats> [<format> ...]\t FOSSLight Report file format ({', '.join(SUPPORT_FORMAT)}) |
30 | | - * Compare mode result file: supports excel, json, yaml, html |
31 | | - * Multiple formats can be specified separated by space. |
32 | | - -e <path>\t\t Path to exclude from analysis (files and directories) |
33 | | - * IMPORTANT: Always wrap patterns in double quotes ("") to avoid shell expansion. |
34 | | - Example) fosslight -e "test/abc.py" "*.jar" |
35 | | - -o <output>\t\t Output directory or file |
36 | | - -c <number>\t\t Number of processes to analyze source |
37 | | - -r\t\t\t Keep raw data |
38 | | - -t\t\t\t Hide the progress bar |
39 | | - -v\t\t\t Print FOSSLight Scanner version |
40 | | - -s <path>\t Path to apply setting from file (check format with 'setting.json' in this repository) |
41 | | - * Direct cli flags have higher priority than setting file |
42 | | - (ex, '-f yaml -s setting.json' - result file extension is .yaml) |
43 | | - --no_correction\t Enter if you don't want to correct OSS information with sbom-info.yaml |
44 | | - * Correction mode only supported xlsx format. |
45 | | - --correct_fpath <path> Path to the sbom-info.yaml file |
46 | | - --ui\t\t Generate UI mode result file |
47 | | - --recursive_dep\t Recursively analyze dependencies |
48 | | -
|
49 | | - Options for only 'all' or 'bin' mode |
50 | | - -u <db_url>\t\t DB Connection(format :'postgresql://username:password@host:port/database_name') |
51 | | -
|
52 | | - Options for only 'all' or 'dependency' mode |
53 | | - -d <dependency_arg>\t Additional arguments for running dependency analysis""" |
| 9 | + π Usage |
| 10 | + ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
| 11 | + fosslight [mode] [options] <arguments> |
| 12 | +
|
| 13 | + π Description |
| 14 | + ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
| 15 | + FOSSLight Scanner performs comprehensive open source analysis by running |
| 16 | + multiple modes (Source, Dependency, Binary) together. It can download |
| 17 | + source code from URLs (git/wget) or analyze local paths, and generates |
| 18 | + results in OSS Report format. |
| 19 | +
|
| 20 | + π Guide: https://fosslight.org/fosslight-guide/scanner/ |
| 21 | +
|
| 22 | + π§ Modes |
| 23 | + ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
| 24 | + all (default) Run all modes (Source, Dependency, Binary) |
| 25 | + source Run FOSSLight Source analysis only |
| 26 | + dependency Run FOSSLight Dependency analysis only |
| 27 | + binary Run FOSSLight Binary analysis only |
| 28 | + compare Compare two FOSSLight reports |
| 29 | +
|
| 30 | + Note: Multiple modes can be specified separated by comma |
| 31 | + Example: fosslight source,binary -p /path/to/analyze |
| 32 | +
|
| 33 | + βοΈ General Options |
| 34 | + ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
| 35 | + -p <path> Path to analyze |
| 36 | + β’ Compare mode: path to two FOSSLight reports (excel/yaml) |
| 37 | + -w <url> URL to download and analyze (git clone or wget) |
| 38 | + -f <format> Output format ({', '.join(SUPPORT_FORMAT)}) |
| 39 | + β’ Compare mode: excel, json, yaml, html |
| 40 | + β’ Multiple formats: ex) -f excel yaml json (separated by space) |
| 41 | + -e <pattern> Exclude paths from analysis (files and directories) |
| 42 | + β οΈ IMPORTANT: Always wrap in quotes to avoid shell expansion |
| 43 | + Example: fosslight -e "test/" "*.jar" |
| 44 | + -o <path> Output directory or file name |
| 45 | + -c <number> Number of processes for source analysis |
| 46 | + -r Keep raw data from scanners |
| 47 | + -t Hide progress bar |
| 48 | + -h Show this help message |
| 49 | + -v Show version information |
| 50 | + -s <path> Apply settings from JSON file(check format with 'setting.json' in this repository) |
| 51 | + Note: CLI flags override settings file |
| 52 | + Example: -f yaml -s setting.json β output is .yaml |
| 53 | + --no_correction Skip OSS information correction with sbom-info.yaml |
| 54 | + (Correction only supports excel format) |
| 55 | + --correct_fpath <path> Path to sbom-info.yaml file for correction |
| 56 | + --ui Generate UI mode result file |
| 57 | + --recursive_dep Recursively analyze dependencies |
| 58 | +
|
| 59 | + π Mode-Specific Options |
| 60 | + ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
| 61 | + For 'all' or 'binary' mode: |
| 62 | + -u <db_url> Database connection string |
| 63 | + Format: postgresql://username:password@host:port/database |
| 64 | +
|
| 65 | + For 'all' or 'dependency' mode: |
| 66 | + -d <args> Additional arguments for dependency analysis |
| 67 | +
|
| 68 | + π‘ Examples |
| 69 | + ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
| 70 | + # Scan current directory with all scanners |
| 71 | + fosslight |
| 72 | +
|
| 73 | + # Scan specific path with exclusions |
| 74 | + fosslight -p /path/to/source -e "test/" "node_modules/" "*.pyc" |
| 75 | +
|
| 76 | + # Generate output in specific format |
| 77 | + fosslight -p /path/to/source -f yaml |
| 78 | +
|
| 79 | + # Run specific modes only |
| 80 | + fosslight source,dependency -p /path/to/source |
| 81 | +
|
| 82 | + # Download and analyze from git repository |
| 83 | + fosslight -w https://github.com/user/repo.git -o result_dir |
| 84 | +
|
| 85 | + # Compare two FOSSLight reports |
| 86 | + fosslight compare -p report_v1.xlsx report_v2.xlsx -f excel |
| 87 | +
|
| 88 | + # Run with database connection for binary analysis |
| 89 | + fosslight binary -p /path/to/binary -u "postgresql://user:pass@localhost:5432/sample" |
| 90 | + """ |
54 | 91 |
|
55 | 92 |
|
56 | 93 | def print_help_msg(): |
|
0 commit comments