Global Options Reference
Purpose
Complete reference for command-line options that are available across all Cabriolet commands. These global options control output verbosity, help display, and version information.
Concepts
Global options are available for every Cabriolet command and can be used in combination with command-specific options. They follow standard Unix conventions and can be specified using either short (-v) or long (--verbose) forms.
Available Global Options
--format FORMAT
Force a specific format for the command, overriding automatic format detection.
Description
The format flag specifies which archive format to use for the operation. This is useful when:
-
Auto-detection fails or is ambiguous
-
Working with files that have incorrect or missing extensions
-
Processing data from stdin or non-standard sources
-
Explicitly specifying the desired format for clarity
Supported formats: cab, chm, szdd, kwaj, hlp, lit, oab
Examples
cabriolet --format chm extract help.chm output/cabriolet extract --format szdd compressed.dat output.txtcabriolet --format cab list archive.unknownUse Cases
Use format override when:
-
Ambiguous files: File has multiple possible format signatures
-
Missing extensions: File extension doesn’t match actual format
-
Data streams: Processing from stdin or pipe (no filename available)
-
Testing: Explicitly testing specific format handlers
-
Migration: Converting from format-specific commands
--verbose, -v
Enable verbose output with detailed progress information.
Description
The verbose flag increases the amount of information displayed during command execution. This includes:
-
Detailed progress for each step
-
File-by-file processing updates
-
Compression/decompression statistics
-
Technical details about operations
-
Timing information
Examples
cabriolet extract --verbose archive.cab output/Opening archive.cab...
Found 3 files in 1 folder
Compression: MSZIP
Extracting to output/
Decompressing folder 1...
readme.txt (1,245 bytes)... OK
setup.exe (524,288 bytes)... OK
config.ini (512 bytes)... OK
Extraction complete
Total: 3 files, 526,045 bytes
Time: 0.5 secondscabriolet create -v archive.cab file1.txt file2.txtCreating archive.cab with MSZIP compression...
Scanning files...
Found 2 files (total: 3,072 bytes)
Creating cabinet structure...
Folder 1: MSZIP compression
Adding files...
file1.txt (1,024 bytes)... compressed to 512 bytes
file2.txt (2,048 bytes)... compressed to 1,024 bytes
Writing cabinet file...
Header: 36 bytes
Folders: 24 bytes
Files: 120 bytes
Data: 1,536 bytes
Successfully created archive.cab
Total: 2 files
Original size: 3,072 bytes
Compressed size: 1,716 bytes
Compression ratio: 44.1%--help, -h
Display command-specific help information.
Description
The help flag shows usage information for the specified command, including:
-
Command syntax
-
Available options
-
Parameter descriptions
-
Example usage
-
See also references
Examples
cabriolet extract --helpUsage: cabriolet extract [OPTIONS] FILE [OUTPUT_DIR]
Extract files from a CAB archive.
Arguments:
FILE Path to the CAB file to extract (required)
OUTPUT_DIR Directory to extract files to (optional, default: .)
Options:
--output, -o DIR Output directory
--verbose, -v Show extraction progress
--salvage Enable salvage mode for corrupted files
--help, -h Display this help message
Examples:
cabriolet extract archive.cab
cabriolet extract archive.cab output/
cabriolet extract --verbose archive.cab extracted/
See also:
cabriolet list --help
cabriolet info --helpcabriolet --helpCabriolet - Microsoft compression format library
Usage: cabriolet COMMAND [OPTIONS] [ARGS]
Unified Commands (auto-detects format):
list List contents of archive file
extract Extract files from archive
create Create new archive
info Show detailed archive information
test Test archive file integrity
search Find embedded CAB files
version Show version information
Legacy Commands (backward compatibility):
CHM Format:
chm-list List contents of CHM file
chm-extract Extract files from CHM
chm-info Show CHM information
chm-create Create new CHM file
SZDD Format:
expand Expand SZDD compressed file
compress Compress file to SZDD format
szdd-info Show SZDD file information
KWAJ Format:
kwaj-extract Extract KWAJ compressed file
kwaj-compress Compress file to KWAJ format
kwaj-info Show KWAJ file information
HLP Format:
hlp-extract Extract files from HLP
hlp-create Create HLP file
hlp-info Show HLP file information
LIT Format:
lit-extract Extract files from LIT eBook
lit-create Create LIT eBook file
lit-info Show LIT file information
OAB Format:
oab-extract Extract OAB file
oab-create Create compressed OAB file
oab-info Show OAB file information
Global Options:
--verbose, -v Enable verbose output
--format FORMAT Force specific format (cab, chm, szdd, kwaj, hlp, lit, oab)
--help, -h Show help message
--version Show version
For command-specific help:
cabriolet COMMAND --help
Examples:
cabriolet list archive.cab
cabriolet extract archive.cab output/
cabriolet create archive.cab file1.txt file2.txt
cabriolet list help.chm (auto-detects CHM)
cabriolet extract --format szdd file.ex_ output.txt
For more information, visit:
https://github.com/omnizip/cabriolet--version
Display Cabriolet version information.
Description
The version flag shows the current version of Cabriolet installed on the system, along with copyright and license information.
Option Precedence
When multiple options affect the same behavior, the last specified option takes precedence.
# Verbose wins (last specified)
cabriolet extract --verbose archive.cab
# Help wins (shows help instead of executing)
cabriolet extract --verbose --help archive.cabCombining Options
Global options can be combined with command-specific options:
# Global + command-specific options
cabriolet create --verbose --compression=lzx archive.cab files/
# Short form combination (Unix style)
cabriolet extract -v archive.cabEnvironment variables
Cabriolet respects the following environment variables:
Output Formats
Standard Output
By default, commands write results to standard output:
cabriolet list archive.cab
# Output goes to terminal
cabriolet list archive.cab > contents.txt
# Redirect to fileExit codes
All Cabriolet commands use standard exit codes:
| Code | Meaning |
|---|---|
0 | Success - operation completed successfully |
1 | General error - operation failed |
2 | Invalid arguments - incorrect command usage |
3 | File not found - specified file doesn’t exist |
4 | Permission denied - insufficient permissions |
5 | Corrupt archive - file data is corrupted |
6 | Unsupported format - format or feature not supported |
Usage in Scripts
#!/bin/bash
# Check exit code
if cabriolet extract archive.cab output/; then
echo "Extraction successful"
else
echo "Extraction failed with code $?"
exit 1
fi
# Handle specific errors
cabriolet extract archive.cab output/
case $? in
0)
echo "Success"
;;
3)
echo "File not found"
;;
5)
echo "Corrupt archive"
;;
*)
echo "Unknown error: $?"
;;
esacBest practices
-
Use verbose for troubleshooting: Always enable verbose mode when diagnosing issues
-
Check help before using new commands: Use
--helpto understand options -
Verify version for bug reports: Include version information when reporting issues
-
Handle exit codes in scripts: Check return values for proper error handling
-
Redirect appropriately: Send output and errors to appropriate streams
-
Set environment defaults: Use environment variables for consistent behavior
Common patterns
Silent Operation
# Suppress all output
cabriolet extract archive.cab output/ > /dev/null 2>&1
# Check only exit code
if cabriolet test archive.cab > /dev/null 2>&1; then
echo "Valid"
fi