Skip to content

Commit

Permalink
use -v instead of environ
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Jul 3, 2023
1 parent b886fa6 commit 187cb77
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions dvc/_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,11 @@ def debugtools(args: Optional["Namespace"] = None, **kwargs):


def add_debugging_flags(parser):
import os
from argparse import SUPPRESS
from dvc.env import DVC_DEBUG

# For detailed info see:
# https://github.com/iterative/dvc/wiki/Debugging,-Profiling-and-Benchmarking-DVC
dvc_show_debug_options = os.environ.get(DVC_DEBUG, "")
dvc_show_debug_options = parser.parse_known_args()[0].verbose

def debug_help(msg):
if dvc_show_debug_options:
Expand Down
2 changes: 1 addition & 1 deletion dvc/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ def get_parent_parser():
from dvc._debug import add_debugging_flags

parent_parser = argparse.ArgumentParser(add_help=False)
add_debugging_flags(parent_parser)
log_level_group = parent_parser.add_mutually_exclusive_group()
log_level_group.add_argument(
"-q", "--quiet", action="count", default=0, help="Be quiet."
)
log_level_group.add_argument(
"-v", "--verbose", action="count", default=0, help="Be verbose."
)
add_debugging_flags(parent_parser)

return parent_parser

Expand Down
1 change: 0 additions & 1 deletion dvc/env.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
DVC_DAEMON = "DVC_DAEMON"
DVC_DEBUG = "DVC_DEBUG"
DVC_EXP_AUTO_PUSH = "DVC_EXP_AUTO_PUSH"
DVC_EXP_BASELINE_REV = "DVC_EXP_BASELINE_REV"
DVC_EXP_GIT_REMOTE = "DVC_EXP_GIT_REMOTE"
Expand Down

0 comments on commit 187cb77

Please sign in to comment.