runInputCli function

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

CLI adapter for fdb input. Accepts optional selector flags, an optional @N ref from fdb describe (fdb input @N "text") and a positional text argument; emits one of:

INPUT=<fieldType> VALUE=<textToEnter> (text entered) IME_ACTION=<action> TARGET=<fieldType> (--action sent) ERROR: No input text provided (no positional, no --action) ERROR: Invalid value for --action: <raw>. ... (bad action) ERROR: Invalid value for --index: <raw> (bad index) ERROR: fdb_helper not detected in running app. ... (no helper) ERROR: <message> (relayed / generic) ERROR: Unexpected response from ext.fdb.enterText: <raw> (unexpected) (AppDiedException rethrown for dispatcher's _formatAppDied) (app died)

Implementation

Future<int> runInputCli(List<String> args) {
  final parser = ArgParser()
    ..addOption('text', help: 'Select field by its label text')
    ..addOption('key', help: 'Select field by its ValueKey string')
    ..addOption('type', help: 'Select field by widget type name')
    ..addOption('index', help: 'Select the Nth matching field (0-based)')
    ..addOption(
      'action',
      help: 'Send an IME action to the field after the text (or alone, without text): '
          '${_actions.join('|')}. Calls TextInputClient.performAction, no keyboard needed.',
    );

  return runCliAdapter(parser, args, _execute);
}