LuaLikeCommandRunner constructor

LuaLikeCommandRunner()

Implementation

LuaLikeCommandRunner()
  : super(
      'lualike',
      'LuaLike $lualikeVersion - A Lua-like scripting language for Dart\n'
          'Lua $luaCompatVersion compatible',
    ) {
  argParser
    ..addFlag(
      'debug',
      help: 'Enable debug mode with detailed logging',
      negatable: false,
    )
    ..addOption(
      'level',
      help: 'Set log level (FINE, INFO, WARNING, SEVERE, etc)',
    )
    ..addMultiOption(
      'category',
      help: 'Set log category filter (repeatable or comma-separated)',
      splitCommas: true,
    )
    ..addFlag('ast', help: 'Use AST interpreter (default)', defaultsTo: true)
    ..addFlag('ir', help: 'Use lualike IR runtime', defaultsTo: false)
    ..addFlag(
      'lua-bytecode',
      help: 'Use the opt-in lua_bytecode source engine',
      defaultsTo: false,
    )
    ..addFlag(
      'dump-ir',
      help: 'Print IR instructions and exit without executing (IR mode)',
      negatable: false,
      defaultsTo: false,
    )
    ..addMultiOption(
      'execute',
      abbr: 'e',
      help: 'Execute string',
      valueHelp: 'code',
      splitCommas: false,
    )
    ..addMultiOption(
      'require',
      abbr: 'l',
      help: 'Require file',
      valueHelp: 'file',
      splitCommas: false,
    )
    ..addFlag(
      'interactive',
      abbr: 'i',
      help: 'Enter interactive mode after running script',
      negatable: false,
    )
    ..addFlag('version', help: 'Print version information', negatable: false)
    ..addOption(
      'emit-docs',
      help: 'Emit built-in library documentation and exit.',
      allowed: const ['html', 'json', 'luals'],
      allowedHelp: const {
        'html': 'Shared documentation UI.',
        'json': 'Editor-friendly library metadata manifest.',
        'luals': 'LuaLS annotation stubs for existing Lua LSPs.',
      },
    )
    ..addOption(
      'emit-docs-output',
      help: 'Output path for --emit-docs. Defaults to stdout.',
      valueHelp: 'path',
    )
    ..addFlag(
      'stdin',
      help: 'Execute stdin as a file (use - on command line)',
      negatable: false,
      hide: true,
    );
}