From f79aa1616898092ad3751ee5fb3b068da4c34695 Mon Sep 17 00:00:00 2001 From: KevinLoesch1 Date: Fri, 23 Feb 2024 11:33:42 -0500 Subject: [PATCH 1/2] Fixes for --help-examples Signed-off-by: KevinLoesch1 --- packages/imperative/CHANGELOG.md | 4 ++++ .../__snapshots__/DefaultHelpGenerator.unit.test.ts.snap | 6 +++--- .../utils/__snapshots__/CommandUtils.unit.test.ts.snap | 4 ++-- packages/imperative/src/cmd/src/utils/CommandUtils.ts | 7 ++++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 078135b4e7..ed15ebd062 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 + +- BugFix: Correct the examples displayed by the `--help-examples` command. [#1865](https://github.com/zowe/zowe-cli/issues/1865) and [#1715](https://github.com/zowe/zowe-cli/issues/1715) + ## `8.0.0-next.202402221834` - Enhancement: Added multiple APIs to the `ProfileInfo` class to help manage schemas between client applications. [#2012](https://github.com/zowe/zowe-cli/issues/2012) diff --git a/packages/imperative/src/cmd/__tests__/help/__snapshots__/DefaultHelpGenerator.unit.test.ts.snap b/packages/imperative/src/cmd/__tests__/help/__snapshots__/DefaultHelpGenerator.unit.test.ts.snap index 3f15d0421d..fcb8ddfc01 100644 --- a/packages/imperative/src/cmd/__tests__/help/__snapshots__/DefaultHelpGenerator.unit.test.ts.snap +++ b/packages/imperative/src/cmd/__tests__/help/__snapshots__/DefaultHelpGenerator.unit.test.ts.snap @@ -11,7 +11,7 @@ exports[`Default Help Generator help text builder buildUsageDiagram test 1`] = ` exports[`Default Help Generator help text builder buildUsageDiagram test 2`] = `"test-help a_experimental_parent hello [options]"`; exports[`Default Help Generator help text builder buildUsageDiagram test 3`] = ` -"test-help child +"test-help a_experimental_parent child Where is one of the following:" `; @@ -162,7 +162,7 @@ exports[`Default Help Generator help text builder getGroupHelpText test 2`] = ` USAGE ----- - test-help child + test-help a_experimental_parent child Where is one of the following: @@ -415,7 +415,7 @@ exports[`Default Help Generator help text builder should getCommandHelpText with USAGE ----- - test-help hello [options] + test-help a_experimental_parent hello [options] GLOBAL OPTIONS -------------- diff --git a/packages/imperative/src/cmd/__tests__/utils/__snapshots__/CommandUtils.unit.test.ts.snap b/packages/imperative/src/cmd/__tests__/utils/__snapshots__/CommandUtils.unit.test.ts.snap index 303a07dd65..d535a0a181 100644 --- a/packages/imperative/src/cmd/__tests__/utils/__snapshots__/CommandUtils.unit.test.ts.snap +++ b/packages/imperative/src/cmd/__tests__/utils/__snapshots__/CommandUtils.unit.test.ts.snap @@ -1042,6 +1042,6 @@ Array [ ] `; -exports[`Command Utils We should not be able get the full command name from the flattened tree 1 1`] = `"test-command"`; +exports[`Command Utils We should not be able get the full command name from the flattened tree 1 1`] = `"test-outer-group test-command"`; -exports[`Command Utils We should not be able get the full command name from the flattened tree 2 1`] = `"test-command"`; +exports[`Command Utils We should not be able get the full command name from the flattened tree 2 1`] = `"test-outer-group test-command"`; diff --git a/packages/imperative/src/cmd/src/utils/CommandUtils.ts b/packages/imperative/src/cmd/src/utils/CommandUtils.ts index f535661524..c8959de62e 100644 --- a/packages/imperative/src/cmd/src/utils/CommandUtils.ts +++ b/packages/imperative/src/cmd/src/utils/CommandUtils.ts @@ -182,7 +182,12 @@ export class CommandUtils { const def = omit(treeEntry.command, "children"); if (isEqual(def, command)) { return treeEntry.fullName; } } + // otherwise, couldn't find it, just return the current name - return commandDef.name; + if(commandTree.name === undefined){ + return commandDef.name; + } else { + return commandTree.name + " " + commandDef.name; + } } } From 3656acdce5f8cc0e1a2424ca45da7ec2379e1c98 Mon Sep 17 00:00:00 2001 From: KevinLoesch1 Date: Fri, 23 Feb 2024 13:34:19 -0500 Subject: [PATCH 2/2] merge change log Signed-off-by: KevinLoesch1 --- packages/imperative/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index ed15ebd062..cdf495acc0 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to the Imperative package will be documented in this file. ## Recent Changes - BugFix: Correct the examples displayed by the `--help-examples` command. [#1865](https://github.com/zowe/zowe-cli/issues/1865) and [#1715](https://github.com/zowe/zowe-cli/issues/1715) +- BugFix: Updated additional dependencies for technical currency. [#2061](https://github.com/zowe/zowe-cli/pull/2061) +- BugFix: Updated engine to Node 16.7.0. [#2061](https://github.com/zowe/zowe-cli/pull/2061) ## `8.0.0-next.202402221834`