Usage:
    This tool detects binary and source code Liferay installments under a
    given path, generates patching settings for it, and based on this setting,
    installs the patches copied into the tool's patches folder.

    Be warned: before any modification on a running Liferay installment,
    shut down the application server, because it might lock some of the
    patched files, so the patching process fails unfinished.

    Simpliest usage:
        copy the patching tool to {appserv_root}/patching-tool folder
        run: patching-tool auto-discovery
        copy the needed patches to {appserv_root}/patching-tool/patches
        shut down the application server
        run: patching-tool install
        restart the application server

Syntax:
    patching-tool [profile_name]
                  [command]
                  [path_of_the_installation]
                  [installation_type]

Commands:
    anything not listed above: displays this help

    auto-discovery: Auto-configuration of the patching tool, generates an
                    installation profile at current path.

                    If no [profile_name] is given as parameter, the profile
                    name will be "default".

                    If no [path_of_the_installation] is given as parameter
                    the tool will try to find a binary Liferay installment
                    at "../".

                    If [path_of_the_installation] points to the application
                    server's folder, [installation_type] parameter must be
                    "binary" or blank.

                    If [path_of_the_installation] points to the Liferay source
                    folder, [installation_type] parameter must be "source".

    info:           Gives patching set-up information based on the profile
                    generated by auto-discovery. If no [profile_name] is given
                    as parameter, the tool will assume that a default profile
                    is present. If not, the tool will exit with an error
                    message.

    revert:         Removes all patches from the installation described in
                    the profile. Make sure that Liferay is down, when executing
                    this command. If no [profile_name] is given as parameter,
                    the tool will assume that a default profile is present. If
                    not, the tool will exit with an error message.

    install:        Installs the patches copied into the patching tool's
                    patches folder into the Liferay installation described in
                    the profile. If no [profile_name] is given as parameter,
                    the tool will assume that a default profile is present. If
                    not, the tool will exit with an error message.
    
    server-status:  Runs the server status script which tells the patching-tool
                    if the application server is running. The server status is
                    checked before install and revert to avoid data corruption
                    if the server.status.script is configured in the properties 
                    file. This command is useful for testing the script.

Examples:
    patching-tool <any invalid input>
                    Displays this help.

    patching-tool auto-discovery
                    Generates a valid default profile if the application
                    server's root can be found at "../"

    patching-tool my_profile auto-discovery /path/of/appserv
    patching-tool my_profile auto-discovery /path/of/appserv binary
                    Generates a valid my_profile file if the application
                    server's root can be found at "/path/of/appserv"

    patching-tool auto-discovery /path/of/liferay/source source
                    Generates a valid default profile file if the Liferay
                    source code can be found at "/path/of/liferay/source"

    patching-tool my_profile info
                    Gives patching set-up information based on the profile
                    generated by auto-discovery.

    patching-tool revert
                    Clears up the installation described in default profile
                    by removing all (all means all, not just the ones in the
                    patches folder) patches from that Liferay instance.
                    Make sure, Liferay is down when executing this.

    patching-tool my_profile install
                    Installs the patches found in the tool's patches folder
                    into the Liferay installation found at the location
                    specified in my_profile. Make sure, Liferay is down when
                    executing this.
