Put in a check to make sure that the config file exists. FIXES austin-taylor/VulnWhisperer#4
This commit is contained in:
@ -6,16 +6,22 @@
|
|||||||
|
|
||||||
from vulnwhisp.vulnwhisp import vulnWhisperer
|
from vulnwhisp.vulnwhisp import vulnWhisperer
|
||||||
from vulnwhisp.utils.cli import bcolors
|
from vulnwhisp.utils.cli import bcolors
|
||||||
|
import os
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
def isFileValid(parser, arg):
|
||||||
|
if not os.path.exists(arg):
|
||||||
|
parser.error("The file %s does not exist!" % arg)
|
||||||
|
else:
|
||||||
|
return arg
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description=""" VulnWhisperer is designed to create actionable data from\
|
parser = argparse.ArgumentParser(description=""" VulnWhisperer is designed to create actionable data from\
|
||||||
your vulnerability scans through aggregation of historical scans.""")
|
your vulnerability scans through aggregation of historical scans.""")
|
||||||
parser.add_argument('-c', '--config', dest='config', required=False, default='frameworks.ini',
|
parser.add_argument('-c', '--config', dest='config', required=False, default='frameworks.ini',
|
||||||
help='Path of config file')
|
help='Path of config file', type=lambda x: isFileValid(parser, x))
|
||||||
parser.add_argument('-v', '--verbose', dest='verbose', action='store_true', default=True,
|
parser.add_argument('-v', '--verbose', dest='verbose', action='store_true', default=True,
|
||||||
help='Prints status out to screen (defaults to True)')
|
help='Prints status out to screen (defaults to True)')
|
||||||
parser.add_argument('-u', '--username', dest='username', required=False, default=None, help='The NESSUS username')
|
parser.add_argument('-u', '--username', dest='username', required=False, default=None, help='The NESSUS username')
|
||||||
|
Reference in New Issue
Block a user