Put in a check to make sure that the config file exists. FIXES austin-taylor/VulnWhisperer#4

This commit is contained in:
Shaun McCullough
2017-12-08 00:25:15 -05:00
parent f8905e8c4b
commit fcd938b75a

View File

@ -6,16 +6,22 @@
from vulnwhisp.vulnwhisp import vulnWhisperer
from vulnwhisp.utils.cli import bcolors
import os
import argparse
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():
parser = argparse.ArgumentParser(description=""" VulnWhisperer is designed to create actionable data from\
your vulnerability scans through aggregation of historical scans.""")
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,
help='Prints status out to screen (defaults to True)')
parser.add_argument('-u', '--username', dest='username', required=False, default=None, help='The NESSUS username')