HLP Commands Reference
Purpose
Complete command-line reference for all HLP (Windows Help) format operations. This document provides detailed syntax, options, and examples for the 3 HLP commands.
Concepts
HLP commands operate on Windows Help files containing multiple internal files compressed with LZSS MODE_MSHELP. Each command handles the internal filesystem and selective compression.
Command Overview
| Command | Purpose |
|---|---|
Extract internal files from HLP file | |
Create HLP file from source files | |
Show HLP file information |
hlp-extract - Extract HLP Files
Extract all internal files from a Windows Help file.
Parameters
FILE-
(required) Path to the HLP file to extract
OUTPUT_DIR-
(optional) Directory to extract files to (default: current directory)
Options
--output, -o-
Output directory (alternative to positional argument)
--verbose, -v-
Show extraction progress for each file
Returns
-
Exit code 0 on success
-
Exit code 1 on error
-
Exit code 3 if file not found
-
Exit code 4 if permission denied
Description
The hlp-extract command extracts all internal files from an HLP archive, including system files (starting with |) and regular content files. Files are decompressed automatically if they use LZSS compression.
Examples
cabriolet hlp-extract help.hlpExtracted 8 file(s) to .cabriolet hlp-extract help.hlp output/cabriolet hlp-extract --verbose help.hlp extracted/Extracting 8 files from help.hlp
|SYSTEM (2,048 bytes, LZSS)... OK
|TOPIC (32,768 bytes, LZSS)... OK
|Phrases (4,096 bytes, LZSS)... OK
|CONTEXT (1,024 bytes, uncompressed)... OK
|FONT (512 bytes, uncompressed)... OK
content.dat (8,192 bytes, LZSS)... OK
index.dat (2,048 bytes, uncompressed)... OK
image.bmp (16,384 bytes, uncompressed)... OK
Extracted 8 file(s) to extracted/cabriolet hlp-extract -o docs/ help.hlpCommon Errors
-
Invalid HLP signature: File is not a valid HLP file
-
Cannot create output directory: Verify write permissions
-
Decompression failed: Internal file is corrupted
-
Unsupported HLP version: HLP version not supported
hlp-create - Create HLP File
Create a new Windows Help file from source files.
Parameters
OUTPUT-
(required) Path for the new HLP file
FILES…-
(required) One or more files to add (with internal names)
Options
--compress-
Compress files with LZSS MODE_MSHELP (default: true)
--no-compress-
Do not compress files
--verbose, -v-
Show creation progress
Returns
-
Exit code 0 on success
-
Exit code 1 on error
-
Exit code 2 if no files specified
-
Exit code 3 if source files not found
-
Exit code 4 if permission denied
Description
The hlp-create command builds a new HLP file from source files. Files can be added with custom internal names (especially for system files starting with |). Compression is applied by default using LZSS MODE_MSHELP.
Examples
cabriolet hlp-create help.hlp system.dat topic.dat phrases.datCreated help.hlp (24,576 bytes, 3 files)cabriolet hlp-create --no-compress help.hlp file1.dat file2.datcabriolet hlp-create --verbose help.hlp system.dat topic.datCreating help.hlp with 2 file(s)
Adding files:
system.dat -> system.dat (compressed)
Original: 2,048 bytes
Compressed: 1,024 bytes
Ratio: 50.0%
topic.dat -> topic.dat (compressed)
Original: 32,768 bytes
Compressed: 16,384 bytes
Ratio: 50.0%
Writing HLP structure...
Header: 16 bytes
Directory: 128 bytes
Data: 17,408 bytes
Created help.hlp (17,552 bytes, 2 files)# Note: This requires API usage for fine control
# CLI creates all files with same compression setting
cabriolet hlp-create --compress help.hlp system.dat topic.dathlp-info - Show HLP Information
Display detailed information about a Windows Help file.
Description
The hlp-info command displays metadata about an HLP file, including version, internal files, compression status, and sizes.
Examples
cabriolet hlp-info help.hlpHLP File Information
==================================================
Filename: help.hlp
Version: 3
Files: 8
Files:
|SYSTEM
Uncompressed: 2,048 bytes
Compressed: 1,024 bytes (LZSS)
|TOPIC
Uncompressed: 32,768 bytes
Compressed: 16,384 bytes (LZSS)
|Phrases
Uncompressed: 4,096 bytes
Compressed: 2,048 bytes (LZSS)cabriolet hlp-info --verbose help.hlpHLP File Information
==================================================
Filename: help.hlp
Version: 3 (Windows 3.x Help format)
Total files: 8
System Files (4):
|SYSTEM
Uncompressed: 2,048 bytes
Compressed: 1,024 bytes (LZSS)
Compression ratio: 50.0%
|TOPIC
Uncompressed: 32,768 bytes
Compressed: 16,384 bytes (LZSS)
Compression ratio: 50.0%
|Phrases
Uncompressed: 4,096 bytes
Compressed: 2,048 bytes (LZSS)
Compression ratio: 50.0%
|CONTEXT
Uncompressed: 1,024 bytes
Compressed: 0 bytes (uncompressed)
Content Files (4):
content.dat
Uncompressed: 8,192 bytes
Compressed: 4,096 bytes (LZSS)
Compression ratio: 50.0%
index.dat
Uncompressed: 2,048 bytes
Compressed: 0 bytes (uncompressed)
image.bmp
Uncompressed: 16,384 bytes
Compressed: 0 bytes (uncompressed)
Overall Statistics:
Total uncompressed: 66,560 bytes
Total compressed: 23,552 bytes
Overall compression: 64.6%
Compressed files: 5
Uncompressed files: 3for file in *.hlp; do
echo "=== $file ==="
cabriolet hlp-info "$file"
echo
doneGlobal Options
All HLP commands support these global options:
--verbose, -v-
Enable verbose output with detailed progress
--help, -h-
Display command help
--version-
Show Cabriolet version
See Global Options for complete details.
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | General error |
2 | Invalid arguments |
3 | File not found |
4 | Permission denied |
5 | Corrupt file |
6 | Unsupported format |
Common Workflows
Extract Legacy Help Files
# Extract all HLP files from old software
mkdir -p extracted-help
for file in *.hlp; do
dir="extracted-help/$(basename "$file" .hlp)"
mkdir -p "$dir"
cabriolet hlp-extract "$file" "$dir"
doneConvert Help Files
# Extract and convert to modern format
for file in legacy/*.hlp; do
base=$(basename "$file" .hlp)
# Extract internal files
cabriolet hlp-extract "$file" "temp/$base"
# Process files...
# (Convert to HTML, CHM, or other format)
doneAnalyze Help Structure
# Analyze all HLP files in directory
echo "HLP File Analysis Report" > report.txt
echo "========================" >> report.txt
echo >> report.txt
for file in *.hlp; do
echo "File: $file" >> report.txt
cabriolet hlp-info "$file" >> report.txt
echo >> report.txt
done
echo "Analysis complete. See report.txt"Internal File Naming
HLP files use specific naming conventions:
Next steps
-
Review Basic Usage Guide for usage examples
-
Study Ruby API Reference for Ruby integration
-
Learn about LZSS MODE_MSHELP