#+TITLE: repl-block

Extract a ~#+begin_src lisp~ block from an .org file and output it to stdout,
ready to pipe to ~repl~ or inspect.

== Usage

#+begin_src shell
  repl-block org/file.org --function foo | repl
  repl-block org/file.org --block 3
  repl-block org/file.org --function foo --package :my-package
  repl-block org/file.org                  # list all blocks
#+end_src

== Identifying blocks

By function name (--function): scans all blocks for (defun <name> ...) and
outputs the containing block. By index (--block): 1-based position in file.

The --package flag prepends an ~(in-package ...)~ form so the REPL evaluates
in the right namespace.

Combine with ~repl~ to send a block directly to the daemon:
  repl-block org/channel-tui-view.org --function view-status --package :passepartout.channel-tui | repl

== Requires

Python 3. No dependencies.
