#620: Add --debug
This commit is contained in:
@@ -24,6 +24,10 @@ class Parser(object):
|
||||
'-y', '--yes',
|
||||
action='store_true',
|
||||
help='execute fixed command without confirmation')
|
||||
self._parser.add_argument(
|
||||
'-d', '--debug',
|
||||
action='store_true',
|
||||
help='enable debug output')
|
||||
self._parser.add_argument('command',
|
||||
nargs='*',
|
||||
help='command that should be fixed')
|
||||
|
||||
+8
-3
@@ -113,10 +113,15 @@ class Settings(dict):
|
||||
|
||||
def _settings_from_args(self, args):
|
||||
"""Loads settings from args."""
|
||||
if args and args.yes:
|
||||
return {'require_confirmation': False}
|
||||
else:
|
||||
if not args:
|
||||
return {}
|
||||
|
||||
from_args = {}
|
||||
if args.yes:
|
||||
from_args['require_confirmation'] = not args.yes
|
||||
if args.debug:
|
||||
from_args['debug'] = args.debug
|
||||
return from_args
|
||||
|
||||
|
||||
settings = Settings(const.DEFAULT_SETTINGS)
|
||||
|
||||
Reference in New Issue
Block a user