simplify main()

This commit is contained in:
John Burwell 2023-04-27 15:10:23 -05:00
parent acc6061c62
commit 52aeb1128f

View File

@ -26,8 +26,7 @@ from rsbbs.controller import Controller
from rsbbs.parser import Parser from rsbbs.parser import Parser
def main(): def parse_args():
# Parse and handle the system invocation arguments # Parse and handle the system invocation arguments
argv_parser = argparse.ArgumentParser( argv_parser = argparse.ArgumentParser(
description=("The BBS for ax.25 and packet radio " description=("The BBS for ax.25 and packet radio "
@ -74,12 +73,15 @@ def main():
version=f"{argv_parser.prog} version {__version__}") version=f"{argv_parser.prog} version {__version__}")
# Parse the args from the system # Parse the args from the system
argv_args = argv_parser.parse_args(sys.argv[1:]) return argv_parser.parse_args(sys.argv[1:])
def main():
# Load configuration # Load configuration
config = Config( config = Config(
app_name='rsbbs', app_name='rsbbs',
args=argv_args) args=parse_args())
# Init the controller # Init the controller
controller = Controller(config) controller = Controller(config)