mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-05 23:09:32 +01:00
cli: Move mutual exclusion of --quiet and --verbose to the parser level (#1271)
Close #1270
This commit is contained in:
+4
-2
@@ -56,13 +56,15 @@ class VersionAction(argparse.Action): # pragma: no cover
|
||||
def parse_args(argv=None):
|
||||
# Common args
|
||||
parent_parser = argparse.ArgumentParser(add_help=False)
|
||||
parent_parser.add_argument(
|
||||
|
||||
log_level_group = parent_parser.add_mutually_exclusive_group()
|
||||
log_level_group.add_argument(
|
||||
'-q',
|
||||
'--quiet',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='Be quiet.')
|
||||
parent_parser.add_argument(
|
||||
log_level_group.add_argument(
|
||||
'-v',
|
||||
'--verbose',
|
||||
action='store_true',
|
||||
|
||||
+3
-2
@@ -15,9 +15,10 @@ class CmdBase(object):
|
||||
|
||||
@staticmethod
|
||||
def _set_loglevel(args):
|
||||
if args.quiet and not args.verbose:
|
||||
if args.quiet:
|
||||
Logger.be_quiet()
|
||||
elif not args.quiet and args.verbose:
|
||||
|
||||
elif args.verbose:
|
||||
Logger.be_verbose()
|
||||
|
||||
def _find_root(self):
|
||||
|
||||
Reference in New Issue
Block a user