INNER CODE UNIT · JavaScript

reportCommandError

sindresorhus/meow · source/index.js:44

const reportCommandError = (message, commands) => {
	console.error(message);
	console.error(`Available commands: ${commands.join(', ')}`);
};

const parseCommand = (input, options, parserOptions, showHelp) => {
	if (!options.commands) {
		return {command: undefined, input};
	}

	if (input.length === 0) {
		return {command: undefined, input: []};
	}

	const command = String(input[0]);

	if (!options.commands.includes(command)) {
		if (!options.allowUnknownFlags && command.startsWith('-')) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…