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

Improve error message for null option definition #2003

Merged
merged 5 commits into from
Jan 5, 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/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to the Zowe CLI package will be documented in this file.

- BugFix: Correct extra character being displayed at the end of lines when issuing `zowe files compare` on Windows. [#1992](https://github.com/zowe/zowe-cli/issues/1992)
- BugFix: Correct the online help description for `zowe files compare uss`. [#1754](https://github.com/zowe/zowe-cli/issues/1754)
- BugFix: Fixed typo in command help for `zowe zos-workflows create` commands.

## `7.20.1`

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
wname=$1
definiton=$2
definition=$2
sysname=$3
owner=$4
set -e
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
wname=$1
definiton=$2
definition=$2
sysname=$3
owner=$4
set -e
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
wname=$1
definiton=$2
definition=$2
sysname=$3
owner=$4
set -e

echo "================Z/OS WORKFLOWS CREATE DATA-SET ==============="
zowe zos-workflows create workflow-from-data-set $wname --data-set "$definiton" --system-name $sysname --owner $owner $5
zowe zos-workflows create workflow-from-data-set $wname --data-set "$definition" --system-name $sysname --owner $owner $5
if [ $? -gt 0 ]
then
exit $?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
wname=$1
definiton=$2
definition=$2
sysname=$3
owner=$4
set -e

echo "================Z/OS WORKFLOWS CREATE LOCAL-FILE ==============="
zowe zos-workflows create workflow-from-local-file $wname --local-file "$definiton" --system-name $sysname --owner $owner $5
zowe zos-workflows create workflow-from-local-file $wname --local-file "$definition" --system-name $sysname --owner $owner $5
if [ $? -gt 0 ]
then
exit $?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
wname=$1
definiton=$2
definition=$2
sysname=$3
owner=$4
set -e

echo "================Z/OS WORKFLOWS CREATE USS-FILE ==============="
zowe zos-workflows create workflow-from-uss-file $wname --uss-file "$definiton" --system-name $sysname --owner $owner $5
zowe zos-workflows create workflow-from-uss-file $wname --uss-file "$definition" --system-name $sysname --owner $owner $5
if [ $? -gt 0 ]
then
exit $?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Object {
"description": "Create a z/OSMF workflow on a z/OS system using a Data set",
"examples": Array [
Object {
"description": "Create a workflow with name \\"testworkflow\\" using the data set \\"TESTID.WKFLOW\\" that contains the workflow definition xml on the system \\"TESTM1\\" with owner \\"OTHERID\\" and delete workflow with the same name if it already exist in z/OSMF",
"description": "Create a workflow with name \\"testworkflow\\" using the data set \\"TESTID.WKFLOW\\" that contains the workflow definition xml on the system \\"TESTM1\\" with owner \\"OTHERID\\" and delete workflow with the same name if it already exists in z/OSMF",
"options": "\\"testworkflow\\" --data-set \\"TESTID.WKFLOW\\" --system-name \\"TESTM1\\" --owner \\"OTHERID\\" --overwrite",
},
Object {
"description": "Create a workflow with name \\"testworkflow\\" using data set \\"TESTID.WKFLOW\\" containing workflow definition xml, on system \\"TESTM1\\" with owner \\"MYSYSID\\" and delete succesfully completed jobs",
"description": "Create a workflow with name \\"testworkflow\\" using data set \\"TESTID.WKFLOW\\" containing workflow definition xml, on system \\"TESTM1\\" with owner \\"MYSYSID\\" and delete successfully completed jobs",
"options": "\\"testworkflow\\" --data-set \\"TESTID.WKFLOW\\" --system-name \\"TESTM1\\" --owner \\"MYSYSID\\" --delete-completed",
},
Object {
Expand All @@ -30,7 +30,7 @@ Object {
"aliases": Array [
"ds",
],
"description": "Data set that contains a workflow definiton.",
"description": "Data set that contains a workflow definition.",
"name": "data-set",
"required": true,
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Object {
"description": "Create a z/OSMF workflow on a z/OS system using a Local file",
"examples": Array [
Object {
"description": "Create a workflow with name \\"testworkflow\\" using the local file \\"TESTID_WKFLOW.xml\\" that contains the workflow definition xml on the system \\"TESTM1\\" with owner \\"OTHERID\\" and delete workflow with the same name if it already exist in z/OSMF",
"description": "Create a workflow with name \\"testworkflow\\" using the local file \\"TESTID_WKFLOW.xml\\" that contains the workflow definition xml on the system \\"TESTM1\\" with owner \\"OTHERID\\" and delete workflow with the same name if it already exists in z/OSMF",
"options": "\\"testworkflow\\" --local-file \\"TESTID_WKFLOW.xml\\" --system-name \\"TESTM1\\" --owner \\"OTHERID\\" --overwrite",
},
],
Expand All @@ -18,7 +18,7 @@ Object {
"aliases": Array [
"lf",
],
"description": "Local file that contains workflow definiton.",
"description": "Local file that contains workflow definition.",
"name": "local-file",
"required": true,
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Object {
"description": "Create a workflow instance in z/OSMF using a USS file",
"examples": Array [
Object {
"description": "Create a workflow with name \\"testworkflow\\" using uss file \\"/path/workflow.xml\\" containing workflow definition, on system \\"TESTM1\\" with owner \\"OTHERID\\" and delete workflow with the same name if it already exist in z/OSMF",
"description": "Create a workflow with name \\"testworkflow\\" using uss file \\"/path/workflow.xml\\" containing workflow definition, on system \\"TESTM1\\" with owner \\"OTHERID\\" and delete workflow with the same name if it already exists in z/OSMF",
"options": "\\"testworkflow\\" --uss-file \\"/path/workflow.xml\\" --system-name \\"TESTM1\\" --owner \\"OTHERID\\" --overwrite",
},
Object {
Expand All @@ -30,7 +30,7 @@ Object {
"aliases": Array [
"uf",
],
"description": "Uss file that contains workflow definiton.",
"description": "Uss file that contains workflow definition.",
"name": "uss-file",
"required": true,
"type": "string",
Expand Down
12 changes: 6 additions & 6 deletions packages/cli/src/workflows/create/Create.common.options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,38 @@ import { ICommandOptionDefinition } from "@zowe/imperative";
export const CreateCommonOptions: { [key: string]: ICommandOptionDefinition } = {

/**
* Data set containing workflow definiton option.
* Data set containing workflow definition option.
* @type {ICommandOptionDefinition}
*/
dataSet: {
name: "data-set",
aliases: ["ds"],
type: "string",
description: "Data set that contains a workflow definiton.",
description: "Data set that contains a workflow definition.",
required: true
},

/**
* Uss file containing workflow definiton option.
* Uss file containing workflow definition option.
* @type {ICommandOptionDefinition}
*/
ussFile: {
name: "uss-file",
aliases: ["uf"],
type: "string",
description: "Uss file that contains workflow definiton.",
description: "Uss file that contains workflow definition.",
required: true
},

/**
* Local file containing workflow definiton option.
* Local file containing workflow definition option.
* @type {ICommandOptionDefinition}
*/
localFile: {
name: "local-file",
aliases: ["lf"],
type: "string",
description: "Local file that contains workflow definiton.",
description: "Local file that contains workflow definition.",
required: true
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ export const DataSet: ICommandDefinition = {
examples: [
{
description: "Create a workflow with name \"testworkflow\" using the data set \"TESTID.WKFLOW\" that contains the workflow " +
"definition xml on the system \"TESTM1\" with owner \"OTHERID\" and delete workflow with the same name if it already exist in z/OSMF",
"definition xml on the system \"TESTM1\" with owner \"OTHERID\" and delete workflow with the same name if it already exists in z/OSMF",
options: "\"testworkflow\" --data-set \"TESTID.WKFLOW\" --system-name \"TESTM1\" --owner \"OTHERID\" --overwrite"
},
{
description: "Create a workflow with name \"testworkflow\" using data set \"TESTID.WKFLOW\" containing workflow definition xml, " +
"on system \"TESTM1\" with owner \"MYSYSID\" and delete succesfully completed jobs",
"on system \"TESTM1\" with owner \"MYSYSID\" and delete successfully completed jobs",
options: "\"testworkflow\" --data-set \"TESTID.WKFLOW\" --system-name \"TESTM1\" --owner \"MYSYSID\" --delete-completed"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const LocalFile: ICommandDefinition = {
examples: [
{
description: "Create a workflow with name \"testworkflow\" using the local file \"TESTID_WKFLOW.xml\" that contains the workflow " +
"definition xml on the system \"TESTM1\" with owner \"OTHERID\" and delete workflow with the same name if it already exist in z/OSMF",
"definition xml on the system \"TESTM1\" with owner \"OTHERID\" and delete workflow with the same name if it already exists in z/OSMF",
options: "\"testworkflow\" --local-file \"TESTID_WKFLOW.xml\" --system-name \"TESTM1\" --owner \"OTHERID\" --overwrite"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const UssFile: ICommandDefinition = {
examples: [
{
description: "Create a workflow with name \"testworkflow\" using uss file \"/path/workflow.xml\" containing workflow definition, " +
"on system \"TESTM1\" with owner \"OTHERID\" and delete workflow with the same name if it already exist in z/OSMF",
"on system \"TESTM1\" with owner \"OTHERID\" and delete workflow with the same name if it already exists in z/OSMF",
options: "\"testworkflow\" --uss-file \"/path/workflow.xml\" --system-name \"TESTM1\" --owner \"OTHERID\" --overwrite"
},
{
Expand Down
4 changes: 4 additions & 0 deletions packages/imperative/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the Imperative package will be documented in this file.

## Recent Changes

- BugFix: Fixed error message shown for null option definition to include details about which command caused the error. [#2002](https://github.com/zowe/zowe-cli/issues/2002)

## `5.19.0`

- Enhancement: Deprecated function AbstractCommandYargs.getBrightYargsResponse in favor of AbstractCommandYargs.getZoweYargsResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ describe("Command Preparer", () => {
expect(error.message).toMatchSnapshot();
});

it("should be able to detect if a chained handlers index is out of bounds", () => {
it("should be able to detect if a chained handlers index is out of bounds", () => {
let error: ImperativeError;
try {
const newDef: ICommandDefinition = {
Expand Down Expand Up @@ -294,7 +294,7 @@ describe("Command Preparer", () => {
});


it("should be able to detect if a chained handler mapping has no 'to' field", () => {
it("should be able to detect if a chained handler mapping has no 'to' field", () => {
let error: Error;
try {
const newDef: ICommandDefinition = {
Expand Down Expand Up @@ -326,7 +326,7 @@ describe("Command Preparer", () => {
});


it("should be able to detect if a chained handler mapping has both a 'from' field and a 'value' field", () => {
it("should be able to detect if a chained handler mapping has both a 'from' field and a 'value' field", () => {
let error: Error;
try {
const newDef: ICommandDefinition = {
Expand Down
Loading