aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-08-11 19:12:00 +0200
committerDuncaen <mail@duncano.de>2017-08-11 19:12:00 +0200
commit8a4b818a15a5257d093c9564d2c3c08451428216 (patch)
treec97678cbd267fda90ae7c594ed4d9860f979857e
parent6158945748738a5f61b8df683dfbf980af9ddb28 (diff)
downloaddotfiles-8a4b818a15a5257d093c9564d2c3c08451428216.tar.gz
bin/cppgrep: import
-rwxr-xr-xbin/cppgrep8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/cppgrep b/bin/cppgrep
new file mode 100755
index 0000000..3d96c4d
--- /dev/null
+++ b/bin/cppgrep
@@ -0,0 +1,8 @@
+#!/bin/sh
+# cppgrep - grep in C/C++ headers
+# 10aug2017 +leah+
+
+printf '#include "%s"' "$@[2,-1]" \
+ | gcc -E -M -MP -x c++ - \
+ | awk -F: '/:$/ {print $1}' \
+ | xe -N0 grep "$1"