src/options.js
function addOptions(flags) {
  Object.keys(options).forEach(function(name) {
    var dashedName = toDashCase(name);
    if ((name in parseOptions) && (name in transformOptions)) {
      flags.option('--' + dashedName + ' [true|false|parse]',
                   descriptions[name]);
      flags.on(dashedName, (value) => setOption(dashedName, value));
    }
    // If the option value is null then it's not a boolean option and should
    // be added separately.
    else if (options[name] !== null) {
      flags.option('--' + dashedName, descriptions[name]);
      flags.on(dashedName, () => setOption(dashedName, true));
    }
  });
  flags.option('--referrer <name>',
    'Bracket output code with System.referrerName=<name>',
    (name) => {
      setOption('referrer', name);
      return name;
    });
  flags.option('--type-assertion-module <path>',
    'Absolute path to the type assertion module.',
    (path) => {
      setOption('type-assertion-module', path);
      return path;
    });
  flags.option('--script <fileName>',
    'Parse as Script (must precede modules)',
    (fileName) => {
      options.scripts.push(fileName);
    });
}
function addOptions(flags) {
  Object.keys(options).forEach(function(name) {
    var dashedName = toDashCase(name);
    if ((name in parseOptions) && (name in transformOptions)) {
      flags.option('--' + dashedName + ' [true|false|parse]',
                   descriptions[name]);
      flags.on(dashedName, (value) => setOption(dashedName, value));
    }
    // If the option value is null then it's not a boolean option and should
    // be added separately.
    else if (options[name] !== null) {
      flags.option('--' + dashedName, descriptions[name]);
      flags.on(dashedName, () => setOption(dashedName, true));
    }
  });
  flags.option('--referrer <name>',
    'Bracket output code with System.referrerName=<name>',
    (name) => {
      setOption('referrer', name);
      return name;
    });
  flags.option('--type-assertion-module <path>',
    'Absolute path to the type assertion module.',
    (path) => {
      setOption('type-assertion-module', path);
      return path;
    });
  flags.option('--script <fileName>',
    'Parse as Script (must precede modules)',
    (fileName) => {
      options.scripts.push(fileName);
    });
}
This is called by build.js to add options to the commander command line
library.
@param {Commander} flags The commander object.