Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eorexx

eorexx logo

An enhanced command-line runner for Open Object Rexx.

Description

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.

Features

  • 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.

Requirements

  • 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).

Building and Installation

Note: Currently, building and compilation have only been verified on Linux.

  1. Clone the repository:

    git clone https://github.com/sparrac/eorexx.git
    cd eorexx
  2. Configure and compile using CMake:

    mkdir build && cd build
    cmake ..
    cmake --build .
  3. (Optional) Install:

    sudo cmake --install .

Quick Start

Running a Script

eorexx hello.rex
eorexx mean.rexx 1 2 3

Running Inline Code

eorexx --eval "say 'Hello'"
eorexx --eval "do arg(1); say 'Repeating...'; end" 3
seq 10 | eorexx -e "s = 0; do while lines() > 0; s += linein(); end; say s"

Running Code from Standard Input

echo "say 'Piped execution'" | eorexx -
cat hello.rex | eorexx -
curl https://raw.githubusercontent.com/sparrac/eorexx/refs/heads/main/examples/mean.rex | eorexx -

Filtering Standard Input

cat input.txt | eorexx --each "say right(linenumber, 4) line"

Measuring Execution Time

eorexx --time hello.rex

CLI Reference

eorexx 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

Planned options

  • -i, --interactive

    Start an interactive REPL shell.

  • --completion [SHELL]

    Generate completion scripts for several shells (bash, zsh, fish...).

  • --wrap SCRIPT EXE

    Bundle SCRIPT into a standalone binary EXE.

  • --unwrap EXE SCRIPT

    Extract the embedded SCRIPT from EXE.

  • --compile SCRIPT [OUT]

    Compile SCRIPT to tokenized format (equivalent to rexxc).

  • --check SCRIPT

    Perform syntax checking (equivalent to rexxc).

Disclaimer

Unlike other of my projects, a significant portion of the code in this repository was generated with the assistance of Large Language Models (LLMs).

License

This project is distributed under the terms described in the LICENSE file.

Author

Salvador Parra Camacho

GitHub: https://github.com/sparrac

About

eorexx is a CLI runner for Open Object Rexx. Features: inline execution, pipeline processing, dynamic directives and others.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages