File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed 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_DEPENDENCY = """
88 Usage: fosslight_dependency [option1] <arg1> [option2] <arg2>...
6464 """
6565
6666
67+ def print_version (pkg_name : str ) -> None :
68+ print_package_version (pkg_name , "FOSSLight Dependency Scanner Version:" )
69+
70+
6771def print_help_msg ():
6872 helpMsg = PrintHelpMsg (_HELP_MESSAGE_DEPENDENCY )
6973 helpMsg .print_help_msg (True )
Original file line number Diff line number Diff line change 77import platform
88import sys
99import argparse
10- import pkg_resources
1110import warnings
1211from datetime import datetime
1312import logging
1615from collections import defaultdict
1716from fosslight_util .set_log import init_log
1817import fosslight_util .constant as constant
19- from fosslight_dependency ._help import print_help_msg
18+ from fosslight_dependency ._help import print_version , print_help_msg
2019from fosslight_dependency ._analyze_dependency import analyze_dependency
2120from fosslight_util .output_format import check_output_formats_v2 , write_output_file
2221from fosslight_util .oss_item import ScannerItem
@@ -361,9 +360,7 @@ def main():
361360 print_help_msg ()
362361
363362 if args .version : # -v option
364- cur_version = pkg_resources .get_distribution (_PKG_NAME ).version
365- print (f"FOSSLight Dependency Scanner Version: { cur_version } " )
366- sys .exit (0 )
363+ print_version (_PKG_NAME )
367364
368365 if args .manager : # -m option
369366 package_manager = '' .join (args .manager )
You can’t perform that action at this time.
0 commit comments