File tree 1 file changed +7
-2
lines changed
src/depinfo/infrastructure/application
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 18
18
19
19
import argparse
20
20
import logging
21
+ import sys
21
22
from typing import List , Optional
22
23
23
24
from depinfo .domain import DependencyReport
24
25
25
26
from .display_service_registry import DisplayServiceRegistry , DisplayType
26
27
27
28
29
+ logger = logging .getLogger ()
30
+
31
+
28
32
MAX_DEPTH = 5
29
33
30
34
@@ -75,8 +79,9 @@ def main(argv: Optional[List[str]] = None) -> None:
75
79
"""Coordinate argument parsing, input validation, and program execution."""
76
80
args = parse_arguments (argv )
77
81
logging .basicConfig (level = args .log_level , format = "[%(levelname)s] %(message)s" )
78
- assert args .max_depth >= 0 , "The maximum depth must be >=0."
79
- assert args .max_depth < MAX_DEPTH , "Don't exaggerate!"
82
+ if not (0 <= args .max_depth < MAX_DEPTH ):
83
+ logger .critical (f"The maximum depth must be >=0 and <{ MAX_DEPTH } ." )
84
+ sys .exit (2 )
80
85
report = DependencyReport .from_root (
81
86
args .package_name ,
82
87
[token .strip () for token in args .build_tools .split ("," )],
You can’t perform that action at this time.
0 commit comments