createParser method

  1. @override
ArgParser createParser(
  1. Iterable<String> args
)
override

Implementation

@override
ArgParser createParser(Iterable<String> args) {
  final _parser = super.createParser(args);

  _parser.addFlag('json',
      defaultsTo: false,
      callback: (x) => generationConfig.useJson = x,
      help:
          'Generate translations as a JSON string rather than as functions.');

  _parser.addFlag("use-deferred-loading",
      defaultsTo: true,
      callback: (x) => generationConfig.useDeferredLoading = x,
      help:
          'Generate message code that must be loaded with deferred loading. '
          'Otherwise, all messages are eagerly loaded.');
  _parser.addOption('codegen_mode',
      allowed: ['release', 'debug'],
      defaultsTo: 'debug',
      callback: (x) => generationConfig.codegenMode = x,
      help:
          'What mode to run the code generator in. Either release or debug.');

  _parser.addOption("translations-list-file",
      callback: (value) => translationsListFile = value,
      help:
          'A file that lists the translation files to process, one per line.'
          'The paths in the file can be absolute or relative to the '
          'location of this file.');

  return _parser;
}