Created
October 13, 2017 19:06
-
-
Save jsoref/e44bd8c07391340284baeaa018001e6c to your computer and use it in GitHub Desktop.
indent exim conf if else endif
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -n | |
# argument: /path/to/exim.conf | |
if (/^\s*\.else/) { | |
$spaces=" "x($level-1); | |
print $spaces.$_; next; | |
} | |
if (/^\s*\.if/) { | |
$spaces=" "x$level; | |
print $spaces.$_; | |
$level++; next; | |
} | |
if (/^\s*\.endif/) { | |
$level--; | |
$spaces=" "x$level; | |
print $spaces.$_; | |
next; | |
} | |
$spaces=" "x$level; | |
print $spaces.$_; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment