code: function checkForUnknownArguments(yargs, argv, command) {
  	const aliasLookup = {};
  	const flags = yargs.getOptions().key;
  	const demanded = yargs.getDemanded();
  	const unknown = [];
  
  	Object.keys(yargs.parsed.aliases || {}).forEach((key) => {
  		yargs.parsed.aliases[key].forEach((alias) => {
  			aliasLookup[alias] = key;
  		});
  	});
  
  	function isUnknown(key) {
  		return (key !== '$0' && key !== '_' && key !== 'params' &&
  			!demanded.hasOwnProperty(key) &&
  			!flags.hasOwnProperty(key) &&
  			!aliasLookup.hasOwnProperty('no-' + key) &&
  			!aliasLookup.hasOwnProperty(key));
  	}
  
  	function aliasFor(key) {
  		return command.unaliasOption(key);
  	}
  
  	Object.keys(argv).forEach((key) => {
  		const alias = aliasFor(key);
  		if (isUnknown(key) && (!alias || isUnknown(alias))) {
  			unknown.push(key);
  		}
  	});
  
  	if (unknown.length) {
  		throw unknownArgumentError(unknown);
  	}
  }
docs: Adapted from: https://github.com/bcoe/yargs/blob/master/lib/validation.js#L83-L110