Features | History | Manual | FAQ | Javadoc
This page generated: December 10 2003

6.2. Usage

Presents the available command line options along with some usage examples.

6.2.1. Synopsis

To start Jalopy from the command line you may either use

jalopy [-options] args...


java Jalopy [-options] args...


java -jar jalopy-<version>.jar [-options] args...

depending on your installation option.

You can specify as many args as you want, where args describes either files, directories or filter expressions. You can use any valid Perl5 (5.003) regular expression as a filter expression.

-c, --convention=FILE   use FILE as code convention file
    --disclaimer        print software disclaimer
-d, --dest=DIR          use DIR as base output directory
-e, --encoding=WORD     assume WORD as encoding of input files where WORD
                        describes one of the JDK supported encodings
                        (if omitted, the platform default is used)
-f, --format=WORD       use WORD as output file format where WORD can be
                        either UNIX, DOS, MAC, AUTO (the default) or DEFAULT
                        (all case-insensitive)
    --force             force formatting even if file up-to-date
-h, --help              display this help
    --nobackup          don't keep backup files
-r, --recursive{=NUM}   recurse into directories, up to NUM levels
                        if NUM is omitted, recurses indefinitely
-t, --thread=NUM        use NUM processing threads
-v, --version           print product version and exit

If no input file(s) are given, Jalopy starts listening on STDIN.

6.2.2. Examples

Example 6.1. Sample command line usage

jalopy -r myDirectory

Formats all Java source files found in directory myDirectory and all subdirectories. Creates backup copies of all files. The file format of the original source files will be kept.

Example 6.2. Sample command line usage

jalopy -d /directory -f DOS
myFile1.java myFile2.java

Formats the two files myFile1.java and myFile2.java and writes the new files into directory /directory. Uses DOS as the file format of the new files.

Example 6.3. Sample command line usage

jalopy -r 3 -d /directory ^A.*java

Formats all Java source files found in the current directory and three levels down that begin with a captial 'A' and writes the new files into directory /tmp. The file format of the original source files will be kept.

Example 6.4. Sample command line usage

type f:\test\in.java | jalopy > out.java

Formats the file f:\test\in.java read from STDIN and outputs its formatted contents to the file out.java in the current directory.

to top