runTapCli function

Future<int> runTapCli(
  1. List<String> args
)

CLI adapter for fdb tap.

Accepts:

  • --text <value>: Widget text selector
  • --key <value>: Widget key selector
  • --type <value>: Widget type selector
  • --index <n>: Widget index (when multiple matches)
  • --x <n>: X coordinate
  • --y <n>: Y coordinate
  • --at <x,y>: Coordinate shorthand (e.g. 200,400)
  • --timeout <secs>: Retry timeout in seconds (default: 5)
  • @N: Ref from fdb describe; names one widget while it stays mounted
  • --expect-text <value>: With @N, fail unless the widget shows this text
  • --expect-type <value>: With @N, fail unless the widget has this type

Implementation

Future<int> runTapCli(List<String> args) async {
  final parser = ArgParser()
    ..addOption('text')
    ..addOption('key')
    ..addOption('type')
    ..addOption('index')
    ..addOption('x')
    ..addOption('y')
    ..addOption('at')
    ..addOption('timeout', defaultsTo: '5')
    ..addOption('expect-text', help: 'With @N: fail unless the widget shows this text (or a " ยท " part of it).')
    ..addOption('expect-type', help: 'With @N: fail unless the widget has this type.');

  return runCliAdapter(parser, args, _execute);
}