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 2
2
# -*- coding: utf-8 -*-
3
3
# Copyright (c) 2021 LG Electronics Inc.
4
4
# SPDX-License-Identifier: Apache-2.0
5
- from fosslight_util .help import PrintHelpMsg
5
+ from fosslight_util .help import PrintHelpMsg , print_package_version
6
6
7
7
_HELP_MESSAGE_DEPENDENCY = """
8
8
Usage: fosslight_dependency [option1] <arg1> [option2] <arg2>...
64
64
"""
65
65
66
66
67
+ def print_version (pkg_name : str ) -> None :
68
+ print_package_version (pkg_name , "FOSSLight Dependency Scanner Version:" )
69
+
70
+
67
71
def print_help_msg ():
68
72
helpMsg = PrintHelpMsg (_HELP_MESSAGE_DEPENDENCY )
69
73
helpMsg .print_help_msg (True )
Original file line number Diff line number Diff line change 7
7
import platform
8
8
import sys
9
9
import argparse
10
- import pkg_resources
11
10
import warnings
12
11
from datetime import datetime
13
12
import logging
16
15
from collections import defaultdict
17
16
from fosslight_util .set_log import init_log
18
17
import 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
20
19
from fosslight_dependency ._analyze_dependency import analyze_dependency
21
20
from fosslight_util .output_format import check_output_formats_v2 , write_output_file
22
21
from fosslight_util .oss_item import ScannerItem
@@ -361,9 +360,7 @@ def main():
361
360
print_help_msg ()
362
361
363
362
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 )
367
364
368
365
if args .manager : # -m option
369
366
package_manager = '' .join (args .manager )
You can’t perform that action at this time.
0 commit comments