Skip to content

Instantly share code, notes, and snippets.

@drewvolz
Last active October 18, 2016 20:53
Show Gist options
  • Save drewvolz/cc348094c9a6f0ec141ea93c8ab8f9e1 to your computer and use it in GitHub Desktop.
Save drewvolz/cc348094c9a6f0ec141ea93c8ab8f9e1 to your computer and use it in GitHub Desktop.
rust-like formatting for C code
#!/bin/sh
if [ -z "$1" ]; then
dir=$(pwd)
else
dir=$1
fi
files=$(find . -name "*.c" -o -name "*.h")
indent -nbad -bap -bbo -bc -br -brf -bli0 -brs -cbi4 -ce -cdw -cli4 -di4 -hnl -i4 -l99 -lc99 -lp -npcs -npsl -nut -ts4 $files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment