The CDT has a command line Eclipse application that allows users to format C/C++ source code either with the Eclipse default code formatter options or with custom options.
Running the Formatter Application
Generating a Config File for the Formatter Application