-
-
Save miku/5cb6bc5c75eb772c944f15faf1755948 to your computer and use it in GitHub Desktop.
like gofmt but for c... and using astyle
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/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