summaryrefslogtreecommitdiff
path: root/tools/list-includes
diff options
context:
space:
mode:
authorOleg Morozenkov <m@oleg.rocks>2018-07-23 02:35:50 +0300
committerOleg Morozenkov <m@oleg.rocks>2018-07-23 02:35:50 +0300
commit98b8b7e4338b71ee46c4301b0bf2ae667be9a99d (patch)
tree32f8b0d32048b2d83b57773c0efa3db9600b8701 /tools/list-includes
parent1dd3affe306793d2129f121c11e43c45ae8690da (diff)
parent167e3e7607e43a0f06c7f87ced94f481e6525b0e (diff)
Merge branch 'master' into nicholascw-master
Diffstat (limited to 'tools/list-includes')
-rwxr-xr-xtools/list-includes19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/list-includes b/tools/list-includes
new file mode 100755
index 0000000..5e04c1a
--- /dev/null
+++ b/tools/list-includes
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+if uname -a | grep Darwin > /dev/null; then
+ is_macos=1
+else
+ is_macos=0
+fi
+if [[ $is_macos == 1 ]]; then
+ this_sed() {
+ gsed "$@"
+ }
+else
+ this_sed() {
+ sed "$@"
+ }
+fi
+
+cd ../include
+tree -a -f --noreport -i | grep '\.h' | this_sed -r 's!^\./(.+?)$!#include "\1"!'