docs: function loadConfig(defaultConfig, opts)
  {
      let config = {},
          userConfig,
          warnAboutMissingConfig = false,
          configPath;
  
      if(!opts.no_config_file) {
          if(opts.config_file) {
              // We only warn about a config file missing if they explicitly specified
              // it on the command line.
              warnAboutMissingConfig = true;
              configPath = opts.config_file;
          }
          else {
              /* istanbul ignore next */
              configPath = process.env.JUTIL_CONFIG_PATH || '~/.jutil/config';
          }
      }
  
      utils.shallowCopy(defaultConfig, config);
  
      if(!configPath)
          return config;
  
      try {
          let realConfigPath = utils.resolvePath(configPath);
          let configFile = utils.loadFile(realConfigPath, false);
          let configSandbox = vm.createContext({
              console: console,
              out: console.log,
              process: process,
              require: require
          });
          
          vm.runInContext(configFile, configSandbox, { 'filename': realConfigPath });
          userConfig = configSandbox.config;
      }
      catch(exc) {
          // It's fine if we didn't find a config file; we'll use the defaults
          if(exc.code == 'ENOENT') {
              if(warnAboutMissingConfig) {
                  console.warn('Warning: unable to load configuration file "' + configPath + '"');
              }
  
              return config;
          }
          else {
              console.error('Error loading configuration file: ' + exc);
              process.exit(1);
          }
      }
  
      if(userConfig) {
          // Validate config file and merge it with the defaults.
          
          copyStringArraySetting(userConfig, config, 'moduleDirectories');
          copyFunctionSetting(userConfig, config, 'prettyPrinter', 2);
          copyFunctionSetting(userConfig, config, 'unprettyPrinter', 2);
          copyFunctionSetting(userConfig, config, 'inputParser', 3);
          copyBooleanSetting(userConfig, config, 'alwaysSortKeys');
          copyBooleanSetting(userConfig, config, 'alwaysPrettyPrint');
          copyEnumSetting(userConfig, config, 'color', ['off', 'force', 'auto', 'auto+pager']);
          copyBooleanSetting(userConfig, config, 'alwaysAutoUnwrap');
          copyStringArraySetting(userConfig, config, 'autoUnwrapProperties');
          copyFunctionSetting(userConfig, config, 'autoUnwrapper', 2);
          copyBooleanSetting(userConfig, config, 'disableWithClause');
          copyBooleanSetting(userConfig, config, 'disableSmartOutput');
          
          if(userConfig.hasOwnProperty('prettyPrintIndent')) {
              switch(typeof userConfig.prettyPrintIndent) {
                  case 'string':
                  case 'number':
                      config.prettyPrintIndent = userConfig.prettyPrintIndent;
                      break;
                  
                  default:
                      console.warn('Warning: prettyPrintIndent property in config file must be a number or string; ignoring the setting');
              }
          }
          
          // Copy over any other properties from the config file
          for(let propName in userConfig) {
              if(userConfig.hasOwnProperty(propName) && !defaultConfig.hasOwnProperty(propName))
                  config[propName] = userConfig[propName];
          }
      }
      else
          console.warn('Warning: config file must assign to the global "config" var; ignoring the file');
      
      return config;
  }