File tree Expand file tree Collapse file tree 4 files changed +17
-4
lines changed Expand file tree Collapse file tree 4 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,13 @@ def main(argv=None):
237
237
dest = 'help' ,
238
238
action = 'store_true' ,
239
239
help = 'show this help message and exit' )
240
+ group .add_argument (
241
+ '--debug' ,
242
+ help = "turn on debug logs for the specified modules" ,
243
+ dest = "loggers_to_debug" ,
244
+ metavar = 'MODULE' ,
245
+ action = 'append' ,
246
+ default = [])
240
247
group .add_argument (
241
248
'--trace' ,
242
249
dest = 'loglevel' ,
@@ -256,6 +263,10 @@ def main(argv=None):
256
263
257
264
args = parser .parse_args (argv )
258
265
266
+ logging .basicConfig (level = args .loglevel or logging .WARNING )
267
+ for logger_name in args .loggers_to_debug :
268
+ logging .getLogger (logger_name ).setLevel (logging .DEBUG )
269
+
259
270
config = Config ()
260
271
config .build_directory_patterns .extend (args .build_paths )
261
272
Original file line number Diff line number Diff line change @@ -3,9 +3,10 @@ usage: compdb [general options] command [command options] [command arguments]
3
3
compdb: the compilation database Swiss army knife
4
4
5
5
general options:
6
- -h, --help show this help message and exit
7
- --trace trace execution
8
- -p BUILD_DIR build path(s)
6
+ -h, --help show this help message and exit
7
+ --debug MODULE turn on debug logs for the specified modules
8
+ --trace trace execution
9
+ -p BUILD_DIR build path(s)
9
10
10
11
available commands:
11
12
help show general or command help
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ cd $(dirname "${BASH_SOURCE[0]}")
6
6
7
7
compdb --help > all-helps.txt.new
8
8
9
- compdb help | grep " ^ [^- ]" | while read command descr; do
9
+ compdb help | grep " ^ [a-z ]" | while read command descr; do
10
10
echo
11
11
echo
12
12
echo " # $command "
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ _compdb() {
40
40
base_opts=(
41
41
' (- :)' {-h,--help}' [show help message and exit]'
42
42
' *-p[build path]:build directory:_files -/'
43
+ ' *--debug[turn on debug logs for the specified modules]:module:'
43
44
' --trace[trace execution]'
44
45
)
45
46
You can’t perform that action at this time.
0 commit comments