Skip to content

Commit 513ab0c

Browse files
Harald AlvestrandWebRTC LUCI CQ
authored andcommitted
Add a -d option to apply-iwyu
This allows users to turn debugging on from the command line instead of modifying the file. Bug: None Change-Id: I37d42a8b745f60720e5b396d695d3b2dda444b8b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306222 Commit-Queue: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#40196}
1 parent e24b34c commit 513ab0c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools_webrtc/iwyu/apply-iwyu

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#
1616
# To get iwyu on Debian/glinux, do "sudo apt-get install iwyu".
1717

18+
# Debug level, also controlled by the "-d" argument.
1819
# Set this to 1 to get more debug information.
1920
# Set this to 2 to also get a dump of the iwyu tool output.
2021
DEBUG=0
@@ -54,15 +55,17 @@ usage() {
5455
echo "Arguments:"
5556
echo " -c compile-commands: Compiler command file"
5657
echo " -r : Remove non-required includes from .h file"
58+
echo " -d <n> : Set debug level to <n>"
5759
echo " -h : Print this help message"
5860
echo "(default command file: out/Default/compile_commands.json - this"
5961
echo "will be generated if not present"
6062
}
6163

62-
while getopts 'c:rh' opts; do
64+
while getopts 'c:d:rh' opts; do
6365
case "${opts}" in
6466
c) COMPILE_COMMANDS="${OPTARG}" ;;
6567
r) FIX_INCLUDE_ARGS="${FIX_INCLUDE_ARGS} --nosafe_headers" ;;
68+
d) DEBUG=${OPTARG};if [ $DEBUG -gt 0 ]; then set -x; fi ;;
6669
h) usage; exit 1 ;;
6770
*) error "Unexpected option ${opts}" ;;
6871
esac

0 commit comments

Comments
 (0)