On Linux I am used to running indent -kr ...
to indent C files. /usr/bin/indent on Mac OS X 10.5 does not support the -kr
option. Does anyone have a ~/.indent.pro file that would produce results closest to K&R style? Thanks!
Press Tab or ⌘] . From the main menu, select Outline > Indent.
The indent program can be used to make code easier to read. It can also convert from one style of writing C to another. indent understands a substantial amount about the syntax of C, but it also attempts to cope with incomplete and misformed syntax.
You can always just get the original gnu indent program and use -kr option. This is probably best as you will have exact results on both machines. But still, if you want to use OS X, this are the flags that make up the -kr option:
-nbad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -cp33 -cs -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l75 -lp -npcs -nprs -npsl -saf -sai -saw -nsc -nsob -nss
MacPorts and Fink both have GNU indent packages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With