Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for --help-examples #2064

Merged
merged 3 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/imperative/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ 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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <positional_argument> [options]"`;

exports[`Default Help Generator help text builder buildUsageDiagram test 3`] = `
"test-help child <command>
"test-help a_experimental_parent child <command>

Where <command> is one of the following:"
`;
Expand Down Expand Up @@ -162,7 +162,7 @@ exports[`Default Help Generator help text builder getGroupHelpText test 2`] = `
USAGE
-----

test-help child <command>
test-help a_experimental_parent child <command>

Where <command> is one of the following:

Expand Down Expand Up @@ -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
--------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"`;
7 changes: 6 additions & 1 deletion packages/imperative/src/cmd/src/utils/CommandUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Loading