Command-Line Interface (CLI)
The djazair executable includes comprehensive command-line options for executing scripts, evaluating inline code strings, inspecting version info, and disassembling bytecode.
CLI Synopsis
bash
djazair [options] [script_file.dz] [arguments...]
Available Command-Line Flags
| Flag | Description | Example |
|---|---|---|
-c <code> |
Executes an inline Djazair code string directly without saving a file. | djazair -c 'print(10 * 4)' |
-v, --version |
Displays the interpreter version, build platform, and compiler information. | djazair -v |
-h, --help |
Prints the help menu and command synopsis. | djazair --help |
-d, --debug |
Enables runtime VM instruction tracing and stack state inspection per opcode. | djazair -d script.dz |
--disassemble |
Disassembles the compiled bytecode chunk into human-readable opcode mnemonics. | djazair --disassemble script.dz |
Inline Code Execution (-c)
The -c option is handy for quick evaluations, shell one-liners, or piping data from command pipelines:
bash
# One-line arithmetic and JSON calculation
djazair -c 'use json; print(json.encode({"status": "healthy", "code": 200}))'
# => {"status":"healthy","code":200}
Accessing Command-Line Arguments
Any arguments passed after the script filename are accessible inside your Djazair script via the process.args() standard library function or the global args array:
djazair
# args_demo.dz
use process
let cliArgs = process.args()
print("Received ${cliArgs.length()} arguments:")
for idx, arg in enumerate(cliArgs)
print(" [${idx}]: ${arg}")
end
bash
djazair args_demo.dz apple banana cherry 42
# Received 4 arguments:
# [0]: apple
# [1]: banana
# [2]: cherry
# [3]: 42