Skip to content

Commit

Permalink
Represent env var DEBUG if set (#241)
Browse files Browse the repository at this point in the history
Conform to command line standards when the DEBUG environment variable is
set.

https://clig.dev/#environment-variables

Signed-off-by: Eric Brown <[email protected]>
  • Loading branch information
ericwb authored Jan 28, 2024
1 parent 2a0db35 commit 8aeaa6f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion precli/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def setup_arg_parser():
description="precli - a static analysis security tool",
formatter_class=argparse.RawDescriptionHelpFormatter,
)

parser.add_argument(
"-d",
"--debug",
Expand Down Expand Up @@ -244,7 +245,9 @@ def parse_file(
def main():
debug = (
logging.DEBUG
if "-d" in sys.argv or "--debug" in sys.argv
if "-d" in sys.argv
or "--debug" in sys.argv
or os.getenv("DEBUG") is not None
else logging.INFO
)
_init_logger(debug)
Expand Down

0 comments on commit 8aeaa6f

Please sign in to comment.