Skip to content

Commit

Permalink
Factor out parser initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
jackstanek committed Jul 26, 2016
1 parent 477dc2a commit b402b79
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions botbot/botbot.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
"""Main method"""
import argparse
import sys

from botbot import __version__
from . import checks, schecks, checker, sqlcache
from . import ignore as ig
from . import daemon
from . import config

def config_sanity_check():
pass # TODO: implement

def main():
parser = argparse.ArgumentParser()
def initialize_parser():
"""Create a big 'ol argument parser"""

from argparse import ArgumentParser
parser = ArgumentParser()

sp = parser.add_subparsers(dest='cmd')
sp.required = True
Expand Down Expand Up @@ -50,5 +51,21 @@ def main():
fs.add_argument('-o', '--out',
help='Write report to a file instead of stdout')

return parser


def main():
# Right off the bat, we want to do a quick sanity check on the
# configuration file. Basically, make sure we have all the
# required fields, and that the
try:
config.config_sanity_check()
except:
#TODO: Implement
pass

# Create the argument parser
parser = initialize_parser()

# Initialize the checker
args = parser.parse_args()

0 comments on commit b402b79

Please sign in to comment.