Usage from the command line
HelpNDoc handles various command line parameters to be able to update and generate documentation without user interface. This is useful to integrate the documentation generation process with an automated build process for example.
Note: The command line syntax has changed in HelpNDoc 5.4 ans is not backward compatible. Check Legacy command line syntax for 5.3 and older to learn more about command line syntax in HelpNDoc 5.3 and earlier.
Command line syntax
The overall command line syntax is as follows:
hnd9.exe [project] [global-options] [command] [command-options]
Where:
Command line option |
Explanation |
hnd9.exe |
HelpNDoc program |
[project] |
Path of the HND project file to open or build. Optional. See Project |
[global-options] |
Options available for every command. Optional. See Global Options |
[command] |
The command to perform. Optional. See Commands |
[command-options] |
Command specific options. Optional. See Commands |
Project
Indicates the full or relative path of a *.HND project file.
When specified without any command, HelpNDoc's user interface is shown and opens with the specified project.
Note: Mandatory for the build command.
Global options
The following options are global: they can be useful for any commands:
Command line option |
Explanation |
-help or -h |
Help on HelpNDoc: show a list of available commands and options |
-log or -l |
Indicates the log file path: any information displayed on the command prompt will also be saved to that file. |
-openhelpid or -oi |
Focus the topic with the specified Help ID once the project is opened |
-openhelpctx or -oc |
Focus the topic with the specified Help context once the project is opened |
-reset or -r |
Reset HelpNDoc settings. When indicated, settings such as window positions, compiler location... won't be loaded from the registry. The new settings are saved to the registry when the application closes. This can be useful to troubleshoot potential settings problems. > hnd9.exe -r |
-silent or -s |
Command line is in silent mode: it will automatically close without user interaction |
-verbose or -v |
Command line is verbose: it will display additional information if available |
-verysilent or -ss |
Command line is in very silent mode: it won't even open a command window |
Commands
The following commands are available from the command line.
Note: Use the -help or -h after the command to get more information about that command.
Command line option |
Explanation |
build |
Build the specified *.hnd project file using either the project's settings or overrides from the command line. See "build" command |
license |
Information and management of the license. See "license" command |
script |
Run a script using the HelpNDoc API to automate project creation or modification. See "script" command |
"build" command
The build command is used to build a *.hnd project file from the command line, without showing HelpNDoc's user interface.
When run without any options, it will use the project settings to generate all enabled builds. It is possible to override some project settings with command options:
Command line option |
Explanation |
-except or -e |
Generates all project builds except the specified ones. It is possible to use this command multiple times. > hnd9.exe myproject.hnd build -e="Build HTML documentation" -e="Build CHM documentation" |
-help or -h |
Help on this command. > hnd9.exe build -h |
-only or -x |
Generates only the specified build names. It is possible to use this command multiple times. > hnd9.exe myproject.hnd build -x="Build PDF documentation" -x="Build Word documentation" |
-output or -o |
Override the output path for a specific build. > hnd9.exe myproject.hnd build -o="Build HTML documentation:c:\www\index.html" |
-statuses or -u |
Override the statuses included for a specific build. > hnd9.exe myproject.hnd build -u="Build HTML documentation:Complete,Needs Review" |
-tags or -a |
Override tags generated for a specific build. > hnd9.exe myproject.hnd build -a="Build HTML documentation:clientA,clientB" |
-template or -t |
Override template used for a specific build. > hnd9.exe myproject.hnd build -t="Build HTML documentation:Legacy HTML framed template" |
"license" command
The license command can be used to manage the license of the full version of HelpNDoc. Available options are:
Command line option |
Explanation |
-activate or -a |
Activate a specific license key on this computer. Make sure the previous license key is deactivated first. > hnd9.exe license -a="ABCDE-FGHIJ-KLMNO-PQRST-UVWXY"
|
-deactivate or -d |
Deactivate a previously activated license on this computer. This makes it possible to move HelpNDoc's license key to another computer. > hnd9.exe license -d
|
-forcecheck or -f |
If you've recently updated your license of HelpNDoc, it is possible that the license key is still not updated: using that command will connect to the license servers to retrieve the latest license details. > hnd9.exe license -f
|
-help or -h |
Help on this command. > hnd9.exe license -h |
-info or -i |
Provides information about the activation of HelpNDoc on this computer. > hnd9.exe license -i |
-offline or -o |
Generate activation / deactivation XML file for offline process. > hnd9.exe license -a="ABCDE-FGHIJ-KLMNO-PQRST-UVWXY" -o="c:\tmp\activation-request.xml" > hnd9.exe license -o="c:\tmp\deactivation-request.xml" |
-proxy or -p |
By default, the license checker will use the proxy set up in Internet Explorer. If you need to customize the proxy, you can indicate the proxy address so that the activation process is able to correctly connect to the license servers. Once done, the proxy address is saved and restored each time the application is launched. Proxy must be in the form "http://username:password@host:port/". Note: if the port is not specified, it will default to 1080. > hnd9.exe license -p="http://username:password@127.0.0.1:8080" |
"script" command
The script command can be used to execute a custom script using the available HelpNDoc API methods to automate project creation or modification. Small scripts can be written in the command line, while large scripts can be loaded from a file.
Note: If a project is specified in the command line syntax, it will be opened first before executing the script, thus simplifying existing projects modification.
Command line option |
Explanation |
-file or -f |
Load the script content from the file path specified. > hnd9.exe script -f="c:\helpndoc\script.pas" Note: If both the -f and -x command line options are defined, only the -x one will be used. |
-help or -h |
Help on this command. > hnd9.exe script -h |
-execute or -x |
Run the script code provided directly on the command line. > hnd9.exe script -x="ShowMessage('OK');" Note: If both the -f and -x command line options are defined, only the -x one will be used. |