Jindent Console Tool

The Jindent console tool is a command line wrapper for all Jindent formatting engines. This tool does not contain any graphical user interface and can be easily used for unattended console invocations, shell scripts and batch processing.

Due to the embedded extension manager, Jindent is able to recognize source code files by its extension (for instance: java, c, cpp, h, hpp, js, sqlj) to choose the right formatting engine for every file. For ambiguous file extension like .h Jindent first tries to format this file as a C source code file and second as C++ source code.

Depending on the used installation package Jindent can be invoked in several ways:

  • Invocation of Jindent through native exe-wrapper or execution scripts:
    Jindent [-options] [<inputfiles>]
  • Invocation of Jindent's shell script on Linux/Unix systems through sh command:
    sh Jindent.sh [-options] [<inputfiles>]
  • Invocation of Jindent through a local Java VM (Java Runtime Environment 1.4 or later is required):
    To invoke Jindent correctly all jar files in Jindent's lib directory have to be included in Java's CLASSPATH. Then Jindent can be invoked like:
    java Jindent [-options] [<inputfiles>]

Invocation Examples

Examples to run Jindent as a command line tool:

  • Print Jindent's help:
    Jindent -h
  • Run Jindent with a specific settings file and format input file:
    Jindent -p MyStyle.xjs inputFile
  • Run Jindent with a specific settings file and format complete directory and subdirectory structure:
    Jindent -r -p MyStyle.xjs inputDir
  • Run Jindent with a specific settings file and format complete directory and subdirectory structure. Additionally write output to a new directory:
    Jindent -r -p MyStyle.xjs -d newOutputDir inputDir
  • Run Jindent with a specific project file created with JindentCommander, execute the project and suppress all output messages:
    Jindent -m -execute MyProject.xjp