Examples

Example 5.1. Sample command-line usage

% jalopy -r /dev/foo/src/java

Formats all source files found in directory /dev/foo/src/java and all subdirectories. The settings from the active profile are used.

Example 5.2. Sample command-line usage

% jalopy -d /test/foo -f DOS File1.java File1.java

Formats the two files File1.java and File2.java and writes the new files into directory /test/foo. Uses the settings from the active profile, but sets DOS as the file format used to write the files.

Example 5.3. Sample command-line usage

% jalopy -c /quality/foo.xml -r -d /test/foo ^A.*java

Formats all Java source files found in the current directory and all subfolders whose name start with a capital 'A' and writes the new files into directory /test/foo. The settings of the code convention /quality/foo.xml are used.

Example 5.4. Sample command-line usage

% type C:\Sources\Foo.java | jalopy > Foo.java

Formats the file C:\Sources\Foo.java read from STDIN and outputs its formatted contents to the file Foo.java in the current directory using the active profile.

Example 5.5. Sample command-line usage

% java -cp /usr/local/jalopy/jalopy-1.9.3.jar Jalopy         \
--convention=/usr/local/jalopy/jalopy.xml --norepository     \
--filespec=/tmp/3bD0W8.lst --track=/tmp/tXO7tE.lst

Formats all files specified in /tmp/3bD0W8.lst according to the given code convention, uses in-memory type lookup, and writes the paths of all files that were actually modified to the track file /tmp/tXO7tE.lst.lst. This is the typical invocation pattern when using Jalopy in a SCM pre-commit trigger to verify that all files have been formatted prior to check-in.