src/config/js-yaml-loader.js
function extendConfig (config, argv) {
  const cliArgs = {}
  let key

  for (key in defaultOptions.get()) {
    cliArgs[key] = argv[key]
  }
  if (argv.port) {
    overrideEndpointOption('port', argv.port, 'websocket', config)
  }
  if (argv.host) {
    overrideEndpointOption('host', argv.host, 'websocket', config)
  }
  if (argv.httpPort) {
    overrideEndpointOption('port', argv.httpPort, 'http', config)
  }
  if (argv.httpHost) {
    overrideEndpointOption('host', argv.httpHost, 'http', config)
  }

  return utils.merge({ plugins: {} }, defaultOptions.get(), config, cliArgs)
}
function extendConfig (config, argv) {
  const cliArgs = {}
  let key

  for (key in defaultOptions.get()) {
    cliArgs[key] = argv[key]
  }
  if (argv.port) {
    overrideEndpointOption('port', argv.port, 'websocket', config)
  }
  if (argv.host) {
    overrideEndpointOption('host', argv.host, 'websocket', config)
  }
  if (argv.httpPort) {
    overrideEndpointOption('port', argv.httpPort, 'http', config)
  }
  if (argv.httpHost) {
    overrideEndpointOption('host', argv.httpHost, 'http', config)
  }

  return utils.merge({ plugins: {} }, defaultOptions.get(), config, cliArgs)
}
function extendConfig ( config , argv ) { const cliArgs = { } let key for ( key in defaultOptions . get ( ) ) { cliArgs [ key ] = argv [ key ] } if ( argv . port ) { overrideEndpointOption ( 'port' , argv . port , 'websocket' , config ) } if ( argv . host ) { overrideEndpointOption ( 'host' , argv . host , 'websocket' , config ) } if ( argv . httpPort ) { overrideEndpointOption ( 'port' , argv . httpPort , 'http' , config ) } if ( argv . httpHost ) { overrideEndpointOption ( 'host' , argv . httpHost , 'http' , config ) } return utils . merge ( { plugins : { } } , defaultOptions . get ( ) , config , cliArgs ) }
Augments the basic configuration with command line parameters
and normalizes paths within it

@param   {Object} config    configuration
@param   {Object} argv      command line arguments
@param   {String} configDir config directory

@private
@returns {Object} extended config
Augments the basic configuration with command line parameters and normalizes paths within it