views:

280

answers:

2

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!

+4  A: 

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

daniel
All these options are documented in the GNU indent man page and this is the first thing I tried. indent on OS X does not implement most of these options.
sigjuice
Well there you go, then you clearly need gnu indent.
daniel
+2  A: 

MacPorts and Fink both have GNU indent packages.

Ned Deily
**@Ned:** I hope you don't mind. I always feel that two separate "<package manager> has what you need" posts are redundant.
dmckee
@dmckee: no problem. Fink certainly can a viable option, too.
Ned Deily