Commit efb939de authored by Marco Mariani's avatar Marco Mariani

enable full tracebacks by default

parent f5386a22
...@@ -10,7 +10,7 @@ class Command(cliff.command.Command): ...@@ -10,7 +10,7 @@ class Command(cliff.command.Command):
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description=self.get_description(), description=self.get_description(),
prog=prog_name, prog=prog_name,
formatter_class=argparse.RawTextHelpFormatter formatter_class=argparse.RawDescriptionHelpFormatter
) )
return parser return parser
...@@ -24,9 +24,10 @@ class SlapOSApp(cliff.app.App): ...@@ -24,9 +24,10 @@ class SlapOSApp(cliff.app.App):
# #
# self.options.verbose_level: # self.options.verbose_level:
# -q -> 0 # -q -> 0 (WARNING)
# -v -> 2 # -> 1 (INFO)
# -vv -> 3 # -v -> 2 (DEBUG)
# -vv -> 3 (...)
# etc. # etc.
# #
...@@ -39,6 +40,12 @@ class SlapOSApp(cliff.app.App): ...@@ -39,6 +40,12 @@ class SlapOSApp(cliff.app.App):
command_manager=SlapOSCommandManager('slapos.cli'), command_manager=SlapOSCommandManager('slapos.cli'),
) )
def build_option_parser(self, *args, **kw):
parser = super(SlapOSApp, self).build_option_parser(*args, **kw)
# always show tracebacks on errors
parser.set_defaults(debug=True)
return parser
def initialize_app(self, argv): def initialize_app(self, argv):
if self.options.verbose_level > 2: if self.options.verbose_level > 2:
self.log.debug('initialize_app') self.log.debug('initialize_app')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment