MCPcopy Index your code
hub / github.com/tj/commander.js / getErrorMessage

Method getErrorMessage

lib/command.js:2105–2113  ·  view source on GitHub ↗
(option)

Source from the content-addressed store, hash-verified

2103 };
2104
2105 const getErrorMessage = (option) => {
2106 const bestOption = findBestOptionFromValue(option);
2107 const optionKey = bestOption.attributeName();
2108 const source = this.getOptionValueSource(optionKey);
2109 if (source === 'env') {
2110 return `environment variable '${bestOption.envVar}'`;
2111 }
2112 return `option '${bestOption.flags}'`;
2113 };
2114
2115 const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;
2116 this.error(message, { code: 'commander.conflictingOption' });

Callers

nothing calls this directly

Calls 2

getOptionValueSourceMethod · 0.95
attributeNameMethod · 0.80

Tested by

no test coverage detected