Module libpt_cli::repl

source ·
Expand description

Create easy and well defined REPLs

A REPL is a Read-Eval-Print-Loop. Well known examples for REPLs are shells (like bash).

This module offers a convenient way to create a well-defined REPL without a lot of complicated code and with a visually pleasing aesthetic. An example REPL implementation can be found in the examples.

The basic idea is that the user defines the commands with an enum and uses claps #[derive(Subcommand)]. A loop is then used to read from the stdin into a buffer, that buffer is put to clap for parsing, similar to how clap would parse commandline arguments.

Modules§

  • Errors for the Repl module

Structs§

Constants§

Traits§

  • Common Trait for repl objects