Created
October 24, 2012 17:36
-
-
Save paulfryzel/3947535 to your computer and use it in GitHub Desktop.
like gofmt but for c... and using astyle
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
#!/usr/bin/env bash | |
# mostly from http://word.bitly.com/post/31921713978/static-analysis | |
function cfmt { | |
if [[ $# -ne 1 ]]; then | |
echo "Usage: cfmt <file>" | |
else | |
astyle \ | |
--style=1tbs \ | |
--lineend=linux \ | |
--convert-tabs \ | |
--preserve-date \ | |
--pad-header \ | |
--indent-switches \ | |
--align-pointer=name \ | |
--align-reference=name \ | |
--pad-oper \ | |
--suffix=none \ | |
$1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
uses 1TBS style formatting