let parse_args only parse, no continuation

This removes parse_args() from the call stack
It pushes down the test-mocking one level [from parse_args() to main()].
Moves parse_args into a more generic 'modules' parsing direction.
This commit is contained in:
kryofly
2018-01-06 11:21:09 +01:00
parent e6e57e47cf
commit 984204e380
4 changed files with 46 additions and 58 deletions

View File

@@ -399,15 +399,18 @@ def cleanup() -> None:
exit(0)
def main() -> None:
def main(sysargv=sys.argv[1:]) -> None:
"""
Loads and validates the config and handles the main loop
:return: None
"""
global _CONF
args = parse_args(sys.argv[1:],
args = parse_args(sysargv,
'Simple High Frequency Trading Bot for crypto currencies')
if not args:
# A subcommand has been issued
if hasattr(args, 'func'):
args.func(args)
exit(0)
# Initialize logger