diff --git a/packages/cli/__tests__/zosconsole/__integration__/collect/__snapshots__/cli.zos-console.collect.response.integration.test.ts.snap b/packages/cli/__tests__/zosconsole/__integration__/collect/__snapshots__/cli.zos-console.collect.response.integration.test.ts.snap index 5378cc8051..48147e6429 100644 --- a/packages/cli/__tests__/zosconsole/__integration__/collect/__snapshots__/cli.zos-console.collect.response.integration.test.ts.snap +++ b/packages/cli/__tests__/zosconsole/__integration__/collect/__snapshots__/cli.zos-console.collect.response.integration.test.ts.snap @@ -190,7 +190,7 @@ Invalid value specified for option: You specified: 123@CA.COM -The value must match one of the following regular expressions: +The value must match one of the following options: [ '^[a-zA-Z0-9]+$' ]. Example: diff --git a/packages/cli/__tests__/zosconsole/__integration__/issue/__snapshots__/cli.zos-console.issue.command.integration.test.ts.snap b/packages/cli/__tests__/zosconsole/__integration__/issue/__snapshots__/cli.zos-console.issue.command.integration.test.ts.snap index 6d3defffaa..e98a637ad9 100644 --- a/packages/cli/__tests__/zosconsole/__integration__/issue/__snapshots__/cli.zos-console.issue.command.integration.test.ts.snap +++ b/packages/cli/__tests__/zosconsole/__integration__/issue/__snapshots__/cli.zos-console.issue.command.integration.test.ts.snap @@ -309,7 +309,7 @@ Invalid value specified for option: You specified: 123@CA.COM -The value must match one of the following regular expressions: +The value must match one of the following options: [ '^[a-zA-Z0-9]+$' ]. Example: diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index f6e156cd5e..688adf40eb 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Imperative package will be documented in this file. +## Recent Changes + +- Patch: Modify error text in SyntaxValidator.invalidOptionError. [#2138](https://github.com/zowe/zowe-cli/issues/2138) + ## `5.23.2` - BugFix: Updated error text for invalid command options so that allowable values are displayed as strings instead of regular expressions when possible. [#1863](https://github.com/zowe/zowe-cli/issues/1863) diff --git a/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts b/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts index 759f23482a..448f7b295f 100644 --- a/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts +++ b/packages/imperative/src/cmd/src/syntax/SyntaxValidator.ts @@ -844,7 +844,7 @@ export class SyntaxValidator { const msg: string = responseObject.console.error( "Invalid value specified for option:\n{{long}} {{aliases}}\n\n" + "You specified:\n{{optionVal}}\n\n" + - "The value must match one of the following regular expressions:\n{{allowed}}.", + "The value must match one of the following options:\n{{allowed}}.", mustacheSummary); this.appendValidatorError(responseObject, {message: msg, optionInError: failingOption.name, definition: failingOption});