980
);
981
}
983
>
if (opt.conflicts) {
984
this.conflicts(key, opt.conflicts);
985
}
987
>
if ('default' in opt) {
988
this.default(key, opt.default);
989
}
991
>
if (opt.implies !== undefined) {
992
this.implies(key, opt.implies);
993
}
995
>
if (opt.nargs !== undefined) {
996
this.nargs(key, opt.nargs);
997
}
999
>
if (opt.config) {
1000
this.config(key, opt.configParser);
1001
}
1003
>
if (opt.normalize) {
1004
this.normalize(key);
1005
}
1007
>
if (opt.choices) {
1008
this.choices(key, opt.choices);
1009
}
1011
>
if (opt.coerce) {
1012
this.coerce(key, opt.coerce);
1013
}
1015
>
if (opt.group) {
1016
this.group(key, opt.group);
1017
}
1019
>
if (opt.boolean || opt.type === 'boolean') {
1020
this.boolean(key);
1021
if (opt.alias) this.boolean(opt.alias);
1022
}
1024
>
if (opt.array || opt.type === 'array') {
1025
this.array(key);
1026
if (opt.alias) this.array(opt.alias);
1027
}
1029
>
if (opt.number || opt.type === 'number') {
1030
this.number(key);
1031
if (opt.alias) this.number(opt.alias);
1032
}
1034
>
if (opt.string || opt.type === 'string') {
1035
this.string(key);
1036
if (opt.alias) this.string(opt.alias);
1037
}
1039
>
if (opt.count || opt.type === 'count') {
1040
this.count(key);
1041
}
1043
>
if (typeof opt.global === 'boolean') {
1044
this.global(key, opt.global);
1045
}
1047
>
if (opt.defaultDescription) {
1048
this.#options.defaultDescription[key] = opt.defaultDescription;
1049
}
1051
>
if (opt.skipValidation) {
1052
this.skipValidation(key);
1053
}
1055
>
const desc = opt.describe || opt.description || opt.desc;
1056
>
const descriptions = this.#usage.getDescriptions();
1057
>
if (
1058
>
!Object.prototype.hasOwnProperty.call(descriptions, key) ||
1059
typeof desc === 'string'
1061
this.describe(key, desc);
1062
}
1064
>
if (opt.hidden) {
1065
this.hide(key);
1066
}
1068
>
if (opt.requiresArg) {
1069
this.requiresArg(key);
1070
}
1072
>
1073
>
return this;
1074
>
}
1075
options(
1076
key: string | Dictionary<OptionDefinition>,