Running the Formatter Application

Running the formatter application is as simple as running the org.eclipse.cdt.core.CodeFormatter application from the commandline:

    eclipse -application org.eclipse.cdt.core.CodeFormatter [ OPTIONS ] [ -config <configFile> ] <files>

When invoked on MacOS, the paths to point to the configuration file or the source files can be relative, but they will be computed from the location of the eclipse.ini file. This is a limitation of the Eclipse launcher on MacOS. On all other platforms, the relative paths are computed relative to the current user directory.

<files> C/C++ source/header files and/or directories to format. Only source/header file endings (like .c .cpp or .h) will be formatted in the given directory.
-config <configFile> Use the formatting style from the specified properties file. Refer to Generating a Config File for the Formatter Application for details.

OPTIONS

Description

-help

Display the help message.

-quiet

Only print error messages.

-verbose

Be verbose about the formatting job.