Names of methods, functions, and variables must precisely describe what the code actually does, and should follow the established naming conventions already used elsewhere in the codebase.
_throwForX if it doesn’t always throw, or getX() if the caller often ignores the return value. Pick a name that matches the real behavior, e.g. rename _throwForMissingExecutable to _checkForMissingExecutable._checkForX validators (_checkForMissingMandatoryOptions, _checkForConflictingOptions, _checkForBrokenPassThrough, etc.) — new validation methods should follow that same _checkForX pattern rather than ad-hoc names like _checkForIllegalPassThroughOptions (which was also semantically wrong, since “illegal” didn’t capture that it’s a broken combination of settings)._ as done for _excessArguments, so API surface is clear at a glance.unknownOption(flag) now receiving multiple unknown options), rename it to unknownOptions to reflect that — but if the method is public API, treat the rename as a breaking change and schedule it for the next major release rather than doing it silently.Example:
// Bad: implies it always throws, doesn't match sibling naming
_throwForMissingExecutable(executableFile, executableDir, subcommandName) { ... }
// Good: follows existing _checkForX convention and reflects actual behavior
_checkForMissingExecutable(executableFile, executableDir, subcommandName) { ... }
Before merging, review method/variable names against their implementation and against similarly-purposed names already in the file to ensure clarity and consistency.</description> </invoke>