File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 11scancode-toolkit
22typecode_libmagic
33XlsxWriter
4- fosslight_util >= 1.3.4
4+ fosslight_util >= 1.3.8
55PyYAML
66wheel
Original file line number Diff line number Diff line change 22# -*- coding: utf-8 -*-
33# Copyright (c) 2021 LG Electronics Inc.
44# SPDX-License-Identifier: Apache-2.0
5- from fosslight_util .help import PrintHelpMsg
5+ from fosslight_util .help import PrintHelpMsg , print_package_version
66
77_HELP_MESSAGE_SOURCE = """
88 Usage: fosslight_source [option1] <arg1> [option2] <arg2>...
1919
2020 Optional
2121 -h\t \t \t \t Print help message
22+ -v\t \t \t \t Print FOSSLight Source Scanner version
2223 -j\t \t \t \t Generate raw result of scanners in json format
2324 -m\t \t \t \t Print the Matched text for each license on a separate sheet (Scancode Only)
2425 -o <output_path>\t \t Output path
3738
3839 Optional
3940 -h\t \t \t \t Print help message
41+ -v\t \t \t \t Print FOSSLight Source Scanner version
4042 -m\t \t \t \t Print the Matched text for each license on a separate sheet
4143 -o <output_path>\t \t Output path
4244 \t \t \t \t (If you want to generate the specific file name, add the output path with file name.)
4345 -f <format>\t \t \t Output file format (excel, csv, opossum)"""
4446
4547
48+ def print_version (pkg_name ):
49+ print_package_version (pkg_name , "FOSSLight Source Scanner Version" )
50+
51+
4652def print_help_msg_source ():
4753 helpMsg = PrintHelpMsg (_HELP_MESSAGE_SOURCE )
4854 helpMsg .print_help_msg (True )
Original file line number Diff line number Diff line change 1313import fosslight_util .constant as constant
1414from fosslight_util .set_log import init_log
1515from fosslight_util .timer_thread import TimerThread
16- from ._help import print_help_msg_source
16+ from ._help import print_help_msg_source , print_version
1717from ._license_matched import get_license_list_to_print
1818from fosslight_util .output_format import check_output_format , write_output_file
1919from .run_scancode import run_scan
@@ -48,10 +48,12 @@ def main():
4848 license_list = []
4949
5050 try :
51- opts , args = getopt .getopt (argv , 'hmjs :p:o:f:' )
51+ opts , args = getopt .getopt (argv , 'hvmjs :p:o:f:' )
5252 for opt , arg in opts :
5353 if opt == "-h" :
5454 print_help_msg_source ()
55+ elif opt == "-v" :
56+ print_version (_PKG_NAME )
5557 elif opt == "-p" :
5658 path_to_scan = arg
5759 elif opt == "-j" :
Original file line number Diff line number Diff line change 1414import yaml
1515from ._parsing_scancode_file_item import parsing_file_item , get_error_from_header
1616from fosslight_util .output_format import check_output_format , write_output_file
17- from ._help import print_help_msg_convert
17+ from ._help import print_help_msg_convert , print_version
1818from ._license_matched import get_license_list_to_print
1919
2020logger = logging .getLogger (constant .LOGGER_NAME )
@@ -133,10 +133,12 @@ def main():
133133 format = ""
134134
135135 try :
136- opts , args = getopt .getopt (argv , 'hmp :o:f:' )
136+ opts , args = getopt .getopt (argv , 'hvmp :o:f:' )
137137 for opt , arg in opts :
138138 if opt == "-h" :
139139 print_help_msg_convert ()
140+ elif opt == "-v" :
141+ print_version (_PKG_NAME )
140142 elif opt == "-p" :
141143 path_to_find_json = arg
142144 elif opt == "-o" :
You can’t perform that action at this time.
0 commit comments