summaryrefslogtreecommitdiff
path: root/tools/indenter-cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/indenter-cpp')
-rwxr-xr-xtools/indenter-cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/indenter-cpp b/tools/indenter-cpp
new file mode 100755
index 0000000..bcdf2e0
--- /dev/null
+++ b/tools/indenter-cpp
@@ -0,0 +1,9 @@
+#!/bin/bash -e
+# this is the implementation of indenter -cpp
+set -o pipefail
+expand |
+sed -e 's:^ *//:&&:' -e 's:^ *#://#:' |
+indenter -ipp |
+sed -e 's:^ *// *#:#:' -e 's:^\( *//\) *//:\1:' |
+pp-indent |
+bs-align