feat: support redirect to another option directly without value (#16038)
This commit is contained in:
1 parent
06c9d77bc5
commit
a9bb9ebafd
2 files changed
+8
-5
No files matched your search
@@ -17,7 +17,7 @@ import {
|
||||
* @property {OptionRangeInfo} [range] - for type int
|
||||
* @property {string} description
|
||||
* @property {string} [deprecated] - deprecated since version
|
||||
* @property {OptionRedirectInfo} [redirect] - redirect deprecated option
|
||||
* @property {OptionRedirectInfo | string} [redirect] - redirect deprecated option
|
||||
* @property {(value: any) => boolean} [exception]
|
||||
* @property {OptionChoiceInfo[]} [choices] - for type choice
|
||||
* @property {string} [cliName]
|
||||
|
||||
@@ -176,10 +176,13 @@ function optionInfoToSchema(optionInfo, { isCLI, optionInfos, FlagSchema }) {
|
||||
!value
|
||||
? undefined
|
||||
: {
|
||||
to: {
|
||||
key: optionInfo.redirect.option,
|
||||
value: optionInfo.redirect.value,
|
||||
},
|
||||
to:
|
||||
typeof optionInfo.redirect === "string"
|
||||
? optionInfo.redirect
|
||||
: {
|
||||
key: optionInfo.redirect.option,
|
||||
value: optionInfo.redirect.value,
|
||||
},
|
||||
};
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
|
||||
Reference in new issue
Block a user