Created
November 28, 2010 07:05
-
-
Save MicahElliott/718675 to your computer and use it in GitHub Desktop.
A personal indentation config for C files, using ‘indent’.
This file contains 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
#! /bin/bash | |
# A personal indentation config for C files, using ‘indent’. | |
# | |
# Every project should agree on and share one of these! | |
# | |
# Install ‘indent’: apt-get install indent | |
# See ‘indent(1)’ for the other 100 options to consider. | |
# | |
# Backups are funny. Using an explicit file here, since most careful | |
# use involves running on one file at a time, which affects backup | |
# scheme. | |
origfile="${1?Provide a C input file}" | |
backup="$1.NOINDENT" | |
cp "$origfile" "$backup" | |
#--braces-on-if-line | |
cmd=" | |
indent | |
--dont-break-procedure-type | |
--tab-size2 | |
--no-tabs | |
--indent-level3 | |
--no-space-after-parentheses | |
--no-space-after-function-call-names | |
$origfile | |
" | |
eval $cmd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment