cli_repl 0.0.1 copy "cli_repl: ^0.0.1" to clipboard
cli_repl: ^0.0.1 copied to clipboard

outdatedDart 1 only

A simple library for CLI REPLs

example/example.dart

/// Example REPL that looks for a semicolon to complete a statement and then
/// echoes all completed statements.

import 'package:cli_repl/cli_repl.dart';

main(args) async {
  var v = (str) => str.trim().isEmpty || str.trim().endsWith(';');
  var repl = new Repl(prompt: '>>> ', continuation: '... ', validator: v);
  await for (var x in repl.run()) {
    if (x.trim().isEmpty) continue;
    print(x);
  }
}
4
likes
0
pub points
95%
popularity

Publisher

unverified uploader

A simple library for CLI REPLs

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

async, io

More

Packages that depend on cli_repl