Using the Command Line Tool

 Table of Contents

1. Invoking DITA Merge

DITA Merge can be run using a command-line interface that is invoked from a terminal window or Windows command line.

Replace x.y.z with the major.minor.patch version number of your release e.g. deltaxml-dita-merge-3.0.0.jar

There are two types of command-line interfaces:

  1. Java API-based command-line interface

    java -jar deltaxml-dita-merge-x.y.z.jar command mergeType arguments
  2. REST API-based command-line interface

    java -jar deltaxml-dita-merge-rest-client-x.y.z.jar command mergeType arguments

    The source code for this interface is available in Bitbucket. This was designed to give you some understanding of the DITA Merge REST API.

The two jars deltaxml-dita-merge-x.y.z.jar and deltaxml-dita-merge-rest-client-x.y.z.jar are included in the distribution.

These interfaces are implemented to quickly run a merge from the command line. However, they do not provide all the features of the Java or REST API such as rule configuration.

2. Supported  Merge Types

Merge Type Description
concurrentN-Way concurrent merge
concurrent3Three way concurrent merge
sequentialN-Way sequential merge

3. Supported Commands

3.1. describe

This command is used to see the description of the available parameters for the specified merge type.

java -jar <jar-name> describe merge-type

For Example,

java -jar <jar-name> describe concurrent

3.2. merge

Runs a merge for the specified merge type. Each file needs to have a name which is used to identify the version in the generated DeltaV2 result.

java -jar <jar-name> merge mergeType
                           ancestorName/version1Name ancestorFile/version1File
                           (versionName versionFile)+ 

The example below will merge three revisions ('anna', 'ben' and 'chris') against the 'ancestor' version with merge type as concurrent. The inputs used in the example below are included in your release in the samples/data directory. Note: the command has been wrapped to aid readability.

java -jar <jar-name> merge concurrent
                           ancestor samples/html-data/four-edits.html
                           anna samples/html-data/four-edits-anna.html
                           ben samples/html-data/four-edits-ben.html
                           chris samples/html-data/four-edits-chris.html

3.3. license

Prints out the current activated license details. NOTE: The REST API-based command-line interface does not support this command.

4. Merge command parameters

Optional command-line parameters can be added to the end of the command-line, these are used to set options for the merge process.

The command-line syntax for parameters is: name=value.

The supported parameters are listed on the page Configuration Options.

#content .code