An enhanced command-line runner for Open Object Rexx.
Unlike other Rexx interpreters (such as Regina or BRexx), the official CLI runner (rexx) included with Open Object Rexx supports very few command-line options.
eorexx is an EXPERIMENTAL CLI tool designed to explore and experiment with richer launcher options and workflow capabilities for Open Object Rexx. It expands execution possibilities by offering quick inline code evaluation (--eval), line-by-line stream processing (--each), execution benchmarking (--time), and on-the-fly directive/source transformations.
- Inline Execution: Run quick Rexx one-liners directly from your shell without creating temporary files.
- Pipeline & Stream Processing: Read scripts or process input streams line-by-line via stdin using UNIX-like pipes.
- Execution Benchmarking: Measure execution time of scripts with a single flag (
--time). - Dynamic Directives: Inject package directives or setup trace modes on the fly.
- Open Object Rexx 5.x (including development header files and native libraries).
- A C/C++ compiler (such as GCC, Clang, or MSVC) and CMake (version 3.10+ recommended).
Note: Currently, building and compilation have only been verified on Linux.
-
Clone the repository:
git clone https://github.com/sparrac/eorexx.git cd eorexx -
Configure and compile using CMake:
mkdir build && cd build cmake .. cmake --build .
-
(Optional) Install:
sudo cmake --install .
eorexx hello.rex
eorexx mean.rexx 1 2 3eorexx --eval "say 'Hello'"
eorexx --eval "do arg(1); say 'Repeating...'; end" 3seq 10 | eorexx -e "s = 0; do while lines() > 0; s += linein(); end; say s"echo "say 'Piped execution'" | eorexx -cat hello.rex | eorexx -curl https://raw.githubusercontent.com/sparrac/eorexx/refs/heads/main/examples/mean.rex | eorexx -cat input.txt | eorexx --each "say right(linenumber, 4) line"eorexx --time hello.rexeorexx 0.1.0
Open Object Rexx CLI
Usage:
eorexx [options] SCRIPT [arguments...]
eorexx --eval CODE [arguments...]
eorexx --stdin [arguments...]
General options:
-h, --help Show this help.
--help-all Show complete help.
-v, --version Show CLI and ooRexx version.
--version-cli Show CLI version.
--version-rexx Show PARSE VERSION output.
--version-engine Show ooRexx engine version.
--pause Wait for Enter before exiting.
-- Stop option parsing.
Pass remaining arguments to the script.
Execution:
-e, --eval CODE Execute CODE as Rexx source.
--each CODE Execute CODE for each input line.
-, --stdin Read program from standard input.
--time Measure execution time.
Source transformation:
-d, --directive TEXT Inject a package directive.
Starts with ":" inserted verbatim.
Otherwise ":OPTIONS" is prepended.
--directive-all Apply the directive to all packages.
-t, --trace MODE Trace options.
Examples:
eorexx hello.rex
eorexx mean.rex 1 2 3
eorexx --eval "say 'Hello'"
eorexx --eval "do arg(1);say 'Hello';end" 3
echo "say 123" | eorexx -
cat hello.rex | eorexx -
seq 10 | eorexx -e "s = 0;do while lines() > 0;s += linein();end;say s"
eorexx --time hello.rex
-
-i, --interactiveStart an interactive REPL shell.
-
--completion [SHELL]Generate completion scripts for several shells (
bash,zsh,fish...). -
--wrap SCRIPT EXEBundle
SCRIPTinto a standalone binaryEXE. -
--unwrap EXE SCRIPTExtract the embedded
SCRIPTfromEXE. -
--compile SCRIPT [OUT]Compile
SCRIPTto tokenized format (equivalent torexxc). -
--check SCRIPTPerform syntax checking (equivalent to
rexxc).
Unlike other of my projects, a significant portion of the code in this repository was generated with the assistance of Large Language Models (LLMs).
This project is distributed under the terms described in the LICENSE file.
Salvador Parra Camacho
GitHub: https://github.com/sparrac