Presents the available command-line options along with some usage examples.
To start Jalopy from the command-line you may either use the provided launch script
% jalopy [-options] filespec...Or use the Java launcher to execute the Jalopy binary directly
% java -jar jalopy-1.9.3.jar [-options] filespec...Or use the Java launcher to call the main class
% java -cp jalopy-1.9.3.jar Jalopy [-options] filespec...Or manually configure the class path and use the Java launcher to invoke the main class
% java Jalopy [-options] filespec...The command-line interface provides many options to control runtime behavior.
Table 5.1. Jalopy Console Plug-in command-line options
| Option | Long Option | Arguments | Description | Since |
|---|---|---|---|---|
| --classpath | <filepath> |
Specifies the class path to use for type lookup. Entries are separated by semi
colons. If you want to have either one of the Optimize imports, Insert Serial Version UID or Ignore runtime exceptions
features working, you need to specify the class path used to compile your
project here.
The class path must contain all types that are needed by your project. Specifying the Java runtime classes is optional - if they are omitted, the runtime classes of the running VM will be automatically added. As a special convenience, specifying a directory is considered equivalent to specifying a list of all the files in the directory with the extension .jar or .JAR | 1.1 | |
| --configure | Invokes the graphical configuration dialog | 1.0 | ||
| -c | --convention | <filepath> |
Specifies the absolute path to the exported code convention whose settings
should be used for formatting, e.g.
“/work/quality/otng-jalopy.xml”.
Please note that specifying an exported code convention impacts your local profiles as Jalopy will import the code convention into the corresponding profile. If no profile with the name stored in the exported code contention exists, it will be created. Specifying a distinct profile to use via the -p,--profile option is therefore useless in this case. When omitted, the settings of the active profile will be used | 1.0 |
| -d | --dest | <filepath> | Sets the destination directory to create/copy all formatting output into. Expects a valid directory name. If the specified directory does not exist, it will be created. When omitted, all input files will be overridden | 1.0 |
| -e | --encoding | <string> | Specifies the encoding that controls how Jalopy interprets text files containing characters beyond the ASCII character set. Expects a Java supported character encoding name (like “US-ASCII”, “ISO-8859-1” or “UTF-8”). Consult the release documentation for your Java implementation to see what encodings are supported. Please note that currently Jalopy does not support any “UTF-16” encoding. When omitted, the platform default encoding will be used | 1.0 |
| --filespec | <filepath> | Specifies the absolute path to a file that defines the filespecs to use for formatting (see below). The filespec strings must be separated by line delimiters. Empty lines are ignored. Please note that you can still define filespecs directly on the command-line. When omitted, the file specs defined on the command-line will be used | 1.7 | |
| -f | --format | <string> | Sets the file format of the output files. The file format controls what end-of-line character is used. Expects either one of “UNIX”, “DOS”, “MAC”, “DEFAULT” or “AUTO” (case insensitive). When omitted, the corresponding code convention setting will be used | 1.0 |
| --force | Sets whether the formatting of files should be forced, even if a file is up-to-date. When omitted, the corresponding code convention setting will be used | 1.0 | ||
| -h | --help | Displays a short help | 1.0 | |
| --history | <string> | Sets the history policy to use. Either one of “ADLER32”, “CRC32” or “NONE” can be used (case insensitive). When omitted, the corresponding code convention setting will used | 1.0 | |
| --input | <string> | Specifies the encoding that controls how Jalopy interprets input text files containing characters beyond the ASCII character set. Expects a Java supported character encoding name (like “US-ASCII”, “ISO-8859-1” or “UTF-8”). Consult the release documentation for your Java implementation to see what encodings are supported. Please note that Jalopy does not yet support any “UTF-16” encoding. When omitted, the platform default encoding will be used | 1.6 | |
| -l | --loglevel | <string> | Specifies the logging level for message output. Expects either one of “ERROR”, “WARN”, “INFO” or “DEBUG” (case insensitive). When omitted, the corresponding code convention settings will be used | 1.0 |
| --look | <string> |
Defines the Swing Look & Feel that should be used. Expects either the fully
qualified name of a Swing Look & Feel that can be found on the class path. Or
the abbreviation for some well known Look & Feels: Alloy, BlackStar,
GreenDream, Liquid, Metal, Motif, Nimbus, PGS, Plastic, Plastic3d, PlasticXP,
Synthetica, Windows (case-insensitive).
Only meaningful in combination with the --configure option. When omitted, the default Look & Feel will be used (varies from platform to platform, but can be configured via the “swing.properties” preferences file) | 1.0 | |
| --nobackup | Indicates that no backup copies should be kept. When omitted, the corresponding code convention setting will be used | 1.0 | ||
| --nofail | Indicates that processing should not stop when an error occurred. When omitted, processing terminates when an error occurs | 1.0 | ||
| --norepository |
Indicates that the type repository should not be used for type lookup. Please
note that this currently means that all dependent features despite the import optimization will be disabled! Only
meaningful when --classpath
has been set.
You may want to use this option if you commonly format a single file or only a small portion of files in order to avoid the maintenance overhead of the type repository. When omitted, the disk based type repository will be used | 1.6 | ||
| --output | <string> | Specifies the character encoding that Jalopy uses to write text files. Expects a Java supported character encoding name (like “US-ASCII”, “ISO-8859-1” or “UTF-8”). Consult the release documentation for your Java implementation to see what encodings are supported. Please note that currently Jalopy does not support any “UTF-16” encoding. When omitted, the platform default encoding will be used | 1.6 | |
| -o | --override | <filepath> or <string> |
Specifies local environment variable overrides. The value might either be a file
path pointing to a properties file with key/value pairs. Or you may specify the
key/value pair(s) directly using a key=value notation where
the different pairs are separated by semicolons, e.g.
-o ";author=John Doo;project=FOZZY"
Please note that when you want to specify several variables, the value string must be enclosed with quotes! Please refer to the section called “Environment” for more information about environment variables. When omitted, only the environment variables defined in the code convention will be used | 1.6 |
| --priority | <integer> | Sets the priority to use for worker threads. Expects an integer between 1-10 (inclusive). Bigger number means higher priority. Defaults to 5 | 1.9.2 | |
| --p | --profile | <string> | Sets the Jalopy profile that should be activated during the formatting run. Expects the name of an existing profile, e.g. “default” for the default profile. The currently active profile will be restored after formatting. When omitted, the currently active profile will be used if no code convention is specified | 1.2.1 |
| --progress | <string> | Displays a progress bar during formatting. Runtime messages will be stored in the file “jalopy.log” in the current working directory | 1.9.2 | |
| -q | --quiet | Suppresses noncritical messages. When omitted, the message settings of the code convention will be used | 1.0 | |
| -r | --recursive | Recursively formats all files in the specified directories. When omitted, only the files in the specified directories will be formatted | 1.0 | |
| --test | <boolean> | Sets whether formatting output should actually be written to disk. If set to “true” no output will be written to disk. When omitted, all output will be written to disk | 1.0 | |
| -t | --thread | <integer> | Specifies the number of processing threads to use. Expects an integer argument between 1-8 (inclusive). When omitted, the corresponding code convention setting will be used | 1.0 |
| --track | <filepath> | Specifies the absolute path to a file where Jalopy will keep track of those files that would be actually formatted during a run. The file path strings will be separated by the platform line delimiter. Implies --test. When omitted, no track file will be written | 1.4 |
Filespecs define the source files and/or directories that should be formatted.
You can specify as many filespecs as you want, where
filespec describes either file paths, directories or
filter expressions. If no filespec is given and no
--filespec
option specified, Jalopy starts listening on STDIN.
You can use any valid regular expression as a filter expression. Jalopy uses Java’s build-in regular expression engine which is roughly equivalent with Perl 5 regular expressions. The syntax is explained here: http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html. For a more precise description of the behavior of regular expression constructs consult Mastering Regular Expressions [Friedl97].