diff --git a/src/fosslight_binary/_help.py b/src/fosslight_binary/_help.py index a0f59d8..29a9002 100644 --- a/src/fosslight_binary/_help.py +++ b/src/fosslight_binary/_help.py @@ -16,7 +16,6 @@ Options: -h\t\t\t\t Print help message -v\t\t\t\t Print FOSSLight Binary Scanner version - -a \t Target Architecture(x86-64, ARM, MIPS, Mach-O, and etc.) -o \t\t Output path \t\t\t\t (If you want to generate the specific file name, add the output path with file name.) -f \t\t\t Output file format (excel, csv, opossum) diff --git a/src/fosslight_binary/binary_analysis.py b/src/fosslight_binary/binary_analysis.py index ce265c7..0ed031b 100755 --- a/src/fosslight_binary/binary_analysis.py +++ b/src/fosslight_binary/binary_analysis.py @@ -247,20 +247,23 @@ def main(): format = "" db_url = "" - opts, args = getopt.getopt(argv, 'hvp:a:o:f:d:') - for opt, arg in opts: - if opt == "-h": - print_help_msg() - elif opt == "-v": - print_package_version(_PKG_NAME, "FOSSLight Binary Scanner Version:") - elif opt == "-p": - path_to_find_bin = arg - elif opt == "-o": - output_dir = arg - elif opt == "-f": - format = arg - elif opt == "-d": - db_url = arg + try: + opts, args = getopt.getopt(argv, 'hvp:o:f:d:') + for opt, arg in opts: + if opt == "-h": + print_help_msg() + elif opt == "-v": + print_package_version(_PKG_NAME, "FOSSLight Binary Scanner Version:") + elif opt == "-p": + path_to_find_bin = arg + elif opt == "-o": + output_dir = arg + elif opt == "-f": + format = arg + elif opt == "-d": + db_url = arg + except Exception: + print_help_msg() _windows = platform.system() == "Windows" if path_to_find_bin == "": diff --git a/tox.ini b/tox.ini index de7dec4..9ef494c 100644 --- a/tox.ini +++ b/tox.ini @@ -37,10 +37,10 @@ deps = commands = fosslight_bin -h - fosslight_bin -p tests -o test_result/result.csv -f csv -a x86_64 + fosslight_bin -p tests -o test_result/result.csv -f csv ls test_result/ cat test_result/result.csv - fosslight_bin -p tests -o test_result/result.json -f opossum -a x86_64 + fosslight_bin -p tests -o test_result/result.json -f opossum pytest -v --flake8 pyinstaller --onefile cli.py -n cli --additional-hooks-dir=hooks {toxinidir}/dist/cli -p tests -o test_result_cli