943
// Addresses: https://github.com/yargs/yargs/issues/1979
944
if (this.#versionOpt && (key === 'version' || opt?.alias === 'version')) {
946
>
[
947
>
'"version" is a reserved word.',
948
>
'Please do one of the following:',
949
>
'- Disable version with `yargs.version(false)` if using "version" as an option',
950
>
'- Use the built-in `yargs.version` method instead (if applicable)',
951
>
'- Use a different option key',
952
>
'https://yargs.js.org/docs/#api-reference-version',
953
>
].join('\n'),
954
>
undefined,
955
>
'versionWarning' // TODO: better dedupeId
956
>
);
957
>
}
958
959
this.#options.key[key] = true; // track manually set keys.