Repository: freqtrade/freqtrade

Issue:
--help produces traceback
Seems I broke it somehow.

`python3 freqtrade hyperopt --help`
produces traceback 
```
Fatal exception!
Traceback (most recent call last):
  File "/home/user/freqtrade-wrk/github-hroff-1902/freqtrade/freqtrade/main.py", line 42, in main
    args: Namespace = arguments.get_parsed_arg()
  File "/home/user/freqtrade-wrk/github-hroff-1902/freqtrade/freqtrade/arguments.py", line 46, in get_parsed_arg
    self.parsed_arg = self.parse_args()
  File "/home/user/freqtrade-wrk/github-hroff-1902/freqtrade/freqtrade/arguments.py", line 54, in parse_args
    parsed_arg = self.parser.parse_args(self.args)
  File "/usr/lib/python3.6/argparse.py", line 1743, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/python3.6/argparse.py", line 1775, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.6/argparse.py", line 1963, in _parse_known_args
    positionals_end_index = consume_positionals(start_index)
  File "/usr/lib/python3.6/argparse.py", line 1940, in consume_positionals
    take_action(action, args)
  File "/usr/lib/python3.6/argparse.py", line 1849, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/lib/python3.6/argparse.py", line 1146, in __call__
    subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)
  File "/usr/lib/python3.6/argparse.py", line 1775, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.6/argparse.py", line 1981, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/lib/python3.6/argparse.py", line 1921, in consume_optional
    take_action(action, args, option_string)
  File "/usr/lib/python3.6/argparse.py", line 1849, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/lib/python3.6/argparse.py", line 1034, in __call__
    parser.exit()
  File "/usr/lib/python3.6/argparse.py", line 2389, in exit
    _sys.exit(status)
SystemExit: 0
```



Discussion:
Not covered by tests.


Resolving patch:
diff --git a/freqtrade/main.py b/freqtrade/main.py
--- a/freqtrade/main.py
+++ b/freqtrade/main.py
@@ -12,7 +12,7 @@
 # flake8: noqa E402
 import logging
 from argparse import Namespace
-from typing import List
+from typing import Any, List
 
 from freqtrade import OperationalException
 from freqtrade.arguments import Arguments
@@ -29,12 +29,11 @@ def main(sysargv: List[str] = None) -> None:
     :return: None
     """
 
+    return_code: Any = 1
+    worker = None
     try:
         set_loggers()
 
-        worker = None
-        return_code = 1
-
         arguments = Arguments(
             sysargv,
             'Free, open source crypto trading bot'
@@ -52,13 +51,15 @@ def main(sysargv: List[str] = None) -> None:
             worker = Worker(args)
             worker.run()
 
+    except SystemExit as e:
+        return_code = e
     except KeyboardInterrupt:
         logger.info('SIGINT received, aborting ...')
         return_code = 0
     except OperationalException as e:
         logger.error(str(e))
         return_code = 2
-    except BaseException:
+    except Exception:
         logger.exception('Fatal exception!')
     finally:
         if worker:


Test patch: