From 982f3c43c5281e8e0d7ab9f241498bd32180f994 Mon Sep 17 00:00:00 2001 From: brycentrivir Date: Wed, 29 Apr 2026 15:13:18 -0600 Subject: [PATCH 1/2] update for FrodoCommand to use conflictsWith --- src/cli/FrodoCommand.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/cli/FrodoCommand.ts b/src/cli/FrodoCommand.ts index 5636393af..01b2d60fe 100644 --- a/src/cli/FrodoCommand.ts +++ b/src/cli/FrodoCommand.ts @@ -388,15 +388,10 @@ function decorateDescriptionWithStability( */ function cloneOption(option: Option): Option { const cloned = Object.assign(new Option(option.flags, option.description), { - defaultValue: option.defaultValue, - defaultValueDescription: option.defaultValueDescription, - presetArg: option.presetArg, - envVar: option.envVar, - parseArg: option.parseArg, - hidden: option.hidden, - mandatory: option.mandatory, + ...option, + // @ts-expect-error: CommanderJS Typings needs an update for node_modules to recognize conflictsWith + conflictsWith: option.conflictsWith ? [...option.conflictsWith] : option.conflictsWith, argChoices: option.argChoices ? [...option.argChoices] : option.argChoices, - helpGroupHeading: option.helpGroupHeading, }); setStabilityMetadata(cloned, getStabilityMetadata(option)); From b78af272f9ebec0978e60c0542beceeb81c23146 Mon Sep 17 00:00:00 2001 From: brycentrivir Date: Fri, 1 May 2026 14:08:58 -0600 Subject: [PATCH 2/2] all conflicts added, flags are now mutually exclusive where necessary --- src/cli/FrodoCommand.ts | 6 +- src/cli/_template/something-delete.ts | 9 +- src/cli/_template/something-else-delete.ts | 11 +- src/cli/_template/something-else-export.ts | 12 +- src/cli/_template/something-else-import.ts | 12 +- src/cli/_template/something-export.ts | 12 +- src/cli/_template/something-import.ts | 12 +- src/cli/_template/something-other-delete.ts | 11 +- src/cli/_template/something-other-export.ts | 12 +- src/cli/_template/something-other-import.ts | 12 +- src/cli/admin/admin-federation-export.ts | 16 +- src/cli/admin/admin-federation-import.ts | 12 +- src/cli/agent/agent-delete.ts | 11 +- src/cli/agent/agent-export.ts | 12 +- src/cli/agent/agent-gateway-delete.ts | 8 +- src/cli/agent/agent-gateway-export.ts | 12 +- src/cli/agent/agent-gateway-import.ts | 12 +- src/cli/agent/agent-import.ts | 12 +- src/cli/agent/agent-java-delete.ts | 9 +- src/cli/agent/agent-java-export.ts | 12 +- src/cli/agent/agent-java-import.ts | 12 +- src/cli/agent/agent-web-delete.ts | 9 +- src/cli/agent/agent-web-export.ts | 12 +- src/cli/agent/agent-web-import.ts | 12 +- src/cli/app/app-delete.ts | 13 +- src/cli/app/app-describe.ts | 4 +- src/cli/app/app-export.ts | 16 +- src/cli/app/app-import.ts | 16 +- src/cli/authz/authz-policy-delete.ts | 13 +- src/cli/authz/authz-policy-export.ts | 16 +- src/cli/authz/authz-policy-import.ts | 12 +- src/cli/authz/authz-set-delete.ts | 11 +- src/cli/authz/authz-set-export.ts | 12 +- src/cli/authz/authz-set-import.ts | 12 +- src/cli/authz/authz-type-delete.ts | 12 +- src/cli/authz/authz-type-describe.ts | 14 +- src/cli/authz/authz-type-export.ts | 16 +- src/cli/authz/authz-type-import.ts | 16 +- .../config-manager-pull-authz-policies.ts | 4 +- .../config-manager-pull-scripts.ts | 20 +- src/cli/config/config-delete.ts | 8 +- src/cli/config/config-export.ts | 19 +- src/cli/config/config-import.ts | 16 +- src/cli/conn/conn-save.ts | 16 +- src/cli/email/email-template-delete.ts | 8 +- src/cli/email/email-template-export.ts | 16 +- src/cli/email/email-template-import.ts | 16 +- src/cli/esv/esv-secret-delete.ts | 9 +- src/cli/esv/esv-secret-export.ts | 12 +- src/cli/esv/esv-secret-import.ts | 12 +- src/cli/esv/esv-secret-version-delete.ts | 9 +- src/cli/esv/esv-variable-delete.ts | 8 +- src/cli/esv/esv-variable-export.ts | 12 +- src/cli/esv/esv-variable-import.ts | 12 +- src/cli/idm/idm-export.ts | 28 +- src/cli/idm/idm-import.ts | 23 +- src/cli/idm/idm-schema-object-export.ts | 19 +- src/cli/idp/idp-export.ts | 16 +- src/cli/idp/idp-import.ts | 12 +- src/cli/journey/journey-delete.ts | 8 +- src/cli/journey/journey-describe.ts | 8 +- src/cli/journey/journey-disable.ts | 4 +- src/cli/journey/journey-enable.ts | 4 +- src/cli/journey/journey-export.ts | 16 +- src/cli/journey/journey-import.ts | 16 +- src/cli/log/log-fetch.ts | 6 +- src/cli/log/log-key-describe.ts | 4 +- src/cli/mapping/mapping-delete.ts | 19 +- src/cli/mapping/mapping-export.ts | 30 +- src/cli/mapping/mapping-import.ts | 12 +- src/cli/mapping/mapping-rename.ts | 8 +- src/cli/node/node-delete.ts | 13 +- src/cli/node/node-export.ts | 16 +- src/cli/node/node-import.ts | 16 +- src/cli/oauth/oauth-client-delete.ts | 9 +- src/cli/oauth/oauth-client-export.ts | 12 +- src/cli/oauth/oauth-client-import.ts | 12 +- src/cli/realm/realm-export.ts | 16 +- src/cli/realm/realm-import.ts | 16 +- src/cli/role/role-delete.ts | 15 +- src/cli/role/role-export.ts | 16 +- src/cli/role/role-import.ts | 16 +- src/cli/saml/saml-cot-export.ts | 14 +- src/cli/saml/saml-cot-import.ts | 12 +- src/cli/saml/saml-delete.ts | 9 +- src/cli/saml/saml-export.ts | 16 +- src/cli/saml/saml-import.ts | 12 +- src/cli/saml/saml-metadata-export.ts | 12 +- src/cli/script/script-delete.ts | 12 +- src/cli/script/script-export.ts | 24 +- src/cli/script/script-import.ts | 14 +- src/cli/secretstore/secretstore-delete.ts | 9 +- src/cli/secretstore/secretstore-export.ts | 12 +- src/cli/secretstore/secretstore-import.ts | 12 +- .../secretstore-mapping-alias-delete.ts | 2 +- .../secretstore/secretstore-mapping-delete.ts | 7 +- src/cli/server/server-delete.ts | 15 +- src/cli/server/server-export.ts | 16 +- src/cli/server/server-import.ts | 16 +- src/cli/service/service-delete.ts | 14 +- src/cli/service/service-export.ts | 15 +- src/cli/service/service-import.ts | 17 +- src/cli/theme/theme-delete.ts | 12 +- src/cli/theme/theme-export.ts | 20 +- src/cli/theme/theme-import.ts | 16 +- .../__snapshots__/agent-delete.test.js.snap | 4 +- .../__snapshots__/agent-export.test.js.snap | 8 +- .../agent-gateway-delete.test.js.snap | 6 +- .../agent-gateway-export.test.js.snap | 8 +- .../agent-gateway-import.test.js.snap | 8 +- .../__snapshots__/agent-import.test.js.snap | 10 +- .../agent-java-delete.test.js.snap | 4 +- .../agent-java-export.test.js.snap | 10 +- .../agent-java-import.test.js.snap | 10 +- .../agent-web-delete.test.js.snap | 4 +- .../agent-web-export.test.js.snap | 10 +- .../agent-web-import.test.js.snap | 10 +- .../en/__snapshots__/app-delete.test.js.snap | 6 +- .../en/__snapshots__/app-export.test.js.snap | 15 +- .../en/__snapshots__/app-import.test.js.snap | 12 +- .../authz-policy-delete.test.js.snap | 7 +- .../authz-policy-export.test.js.snap | 13 +- .../authz-policy-import.test.js.snap | 9 +- .../authz-set-delete.test.js.snap | 5 +- .../authz-set-export.test.js.snap | 8 +- .../authz-set-import.test.js.snap | 8 +- .../authz-type-delete.test.js.snap | 10 +- .../authz-type-describe.test.js.snap | 4 +- .../authz-type-export.test.js.snap | 12 +- .../authz-type-import.test.js.snap | 12 +- .../__snapshots__/config-export.test.js.snap | 9 +- .../__snapshots__/config-import.test.js.snap | 13 +- ...manager-export-authz-policies.test.js.snap | 2 +- ...config-manager-export-scripts.test.js.snap | 14 +- .../en/__snapshots__/conn-save.test.js.snap | 16 +- .../email-template-delete.test.js.snap | 8 +- .../email-template-export.test.js.snap | 12 +- .../email-template-import.test.js.snap | 8 +- .../esv-secret-delete.test.js.snap | 5 +- .../esv-secret-export.test.js.snap | 11 +- .../esv-secret-import.test.js.snap | 11 +- .../esv-secret-version-delete.test.js.snap | 5 +- .../esv-variable-delete.test.js.snap | 6 +- .../esv-variable-export.test.js.snap | 10 +- .../esv-variable-import.test.js.snap | 10 +- .../en/__snapshots__/idm-export.test.js.snap | 23 +- .../en/__snapshots__/idm-import.test.js.snap | 16 +- .../en/__snapshots__/idp-export.test.js.snap | 11 +- .../en/__snapshots__/idp-import.test.js.snap | 8 +- .../__snapshots__/journey-delete.test.js.snap | 8 +- .../journey-describe.test.js.snap | 4 +- .../__snapshots__/journey-export.test.js.snap | 12 +- .../__snapshots__/journey-import.test.js.snap | 10 +- .../en/__snapshots__/log-fetch.test.js.snap | 4 +- .../__snapshots__/mapping-delete.test.js.snap | 8 +- .../__snapshots__/mapping-export.test.js.snap | 12 +- .../__snapshots__/mapping-import.test.js.snap | 9 +- .../__snapshots__/mapping-rename.test.js.snap | 18 +- .../en/__snapshots__/node-delete.test.js.snap | 9 +- .../en/__snapshots__/node-export.test.js.snap | 12 +- .../en/__snapshots__/node-import.test.js.snap | 12 +- .../oauth-client-delete.test.js.snap | 4 +- .../oauth-client-export.test.js.snap | 10 +- .../oauth-client-import.test.js.snap | 7 +- .../__snapshots__/realm-export.test.js.snap | 16 +- .../__snapshots__/realm-import.test.js.snap | 15 +- .../en/__snapshots__/role-export.test.js.snap | 10 +- .../en/__snapshots__/role-import.test.js.snap | 10 +- .../saml-cot-export.test.js.snap | 13 +- .../saml-cot-import.test.js.snap | 12 +- .../en/__snapshots__/saml-delete.test.js.snap | 5 +- .../en/__snapshots__/saml-export.test.js.snap | 11 +- .../en/__snapshots__/saml-import.test.js.snap | 9 +- .../saml-metadata-export.test.js.snap | 6 +- .../__snapshots__/script-delete.test.js.snap | 12 +- .../__snapshots__/script-export.test.js.snap | 20 +- .../__snapshots__/script-import.test.js.snap | 12 +- .../secretstore-delete.test.js.snap | 4 +- .../secretstore-export.test.js.snap | 6 +- .../secretstore-import.test.js.snap | 6 +- ...retstore-mapping-alias-delete.test.js.snap | 2 +- .../secretstore-mapping-delete.test.js.snap | 2 +- .../__snapshots__/server-export.test.js.snap | 12 +- .../__snapshots__/server-import.test.js.snap | 12 +- .../__snapshots__/service-delete.test.js.snap | 4 +- .../__snapshots__/service-export.test.js.snap | 9 +- .../__snapshots__/service-import.test.js.snap | 12 +- .../__snapshots__/theme-delete.test.js.snap | 12 +- .../__snapshots__/theme-export.test.js.snap | 15 +- .../__snapshots__/theme-import.test.js.snap | 15 +- .../authz-policy-export.e2e.test.js.snap | 6 +- ...ig-manager-export-scripts.e2e.test.js.snap | 13252 +--------------- test/e2e/authz-policy-export.e2e.test.js | 6 +- .../config-manager-export-scripts.e2e.test.js | 12 +- .../am_1076162899/recording.har | 208 +- .../environment_1072573434/recording.har | 125 + .../oauth2_393036114/recording.har | 26 +- .../openidm_3290118515/recording.har | 62 +- .../oauth2_393036114/recording.har | 138 - .../openidm_3290118515/recording.har | 150 - .../am_1076162899/recording.har | 768 - .../am_1076162899/recording.har | 464 - .../am_1076162899/recording.har | 464 + .../environment_1072573434/recording.har | 125 + .../oauth2_393036114/recording.har | 22 +- .../openidm_3290118515/recording.har | 62 +- 206 files changed, 2104 insertions(+), 15946 deletions(-) rename test/e2e/mocks/authz_674614127/policy-export_1534086044/{0_policy-id_f_set-id_no-deps_prereqs_816532612 => 0_policy-id_f_no-deps_prereqs_1167016081}/am_1076162899/recording.har (77%) create mode 100644 test/e2e/mocks/authz_674614127/policy-export_1534086044/0_policy-id_f_no-deps_prereqs_1167016081/environment_1072573434/recording.har rename test/e2e/mocks/{config-manager_4167095917/pull_2167214206/scripts_2605322907/0_D_r_p_just-config_script-type_just-content_language_3996063049 => authz_674614127/policy-export_1534086044/0_policy-id_f_no-deps_prereqs_1167016081}/oauth2_393036114/recording.har (79%) rename test/e2e/mocks/{config-manager_4167095917/pull_2167214206/scripts_2605322907/0_D_just-config_just-content_4050649083 => authz_674614127/policy-export_1534086044/0_policy-id_f_no-deps_prereqs_1167016081}/openidm_3290118515/recording.har (61%) delete mode 100644 test/e2e/mocks/authz_674614127/policy-export_1534086044/0_policy-id_f_set-id_no-deps_prereqs_816532612/oauth2_393036114/recording.har delete mode 100644 test/e2e/mocks/authz_674614127/policy-export_1534086044/0_policy-id_f_set-id_no-deps_prereqs_816532612/openidm_3290118515/recording.har delete mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/scripts_2605322907/0_D_just-config_just-content_4050649083/am_1076162899/recording.har delete mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/scripts_2605322907/0_D_r_p_just-config_script-type_just-content_language_3996063049/am_1076162899/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/scripts_2605322907/0_D_r_p_script-type_just-content_language_3587286889/am_1076162899/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/scripts_2605322907/0_D_r_p_script-type_just-content_language_3587286889/environment_1072573434/recording.har rename test/e2e/mocks/config-manager_4167095917/pull_2167214206/scripts_2605322907/{0_D_just-config_just-content_4050649083 => 0_D_r_p_script-type_just-content_language_3587286889}/oauth2_393036114/recording.har (81%) rename test/e2e/mocks/config-manager_4167095917/pull_2167214206/scripts_2605322907/{0_D_r_p_just-config_script-type_just-content_language_3996063049 => 0_D_r_p_script-type_just-content_language_3587286889}/openidm_3290118515/recording.har (61%) diff --git a/src/cli/FrodoCommand.ts b/src/cli/FrodoCommand.ts index 01b2d60fe..f4cee52fc 100644 --- a/src/cli/FrodoCommand.ts +++ b/src/cli/FrodoCommand.ts @@ -390,7 +390,11 @@ function cloneOption(option: Option): Option { const cloned = Object.assign(new Option(option.flags, option.description), { ...option, // @ts-expect-error: CommanderJS Typings needs an update for node_modules to recognize conflictsWith - conflictsWith: option.conflictsWith ? [...option.conflictsWith] : option.conflictsWith, + conflictsWith: option.conflictsWith + ? // @ts-expect-error: Linter will do this and ts-expect-error cant be multi line. + [...option.conflictsWith] + : // @ts-expect-error: Linter will do this and ts-expect-error cant be multi line. + option.conflictsWith, argChoices: option.argChoices ? [...option.argChoices] : option.argChoices, }); diff --git a/src/cli/_template/something-delete.ts b/src/cli/_template/something-delete.ts index 4e72f51e0..52271c2f8 100644 --- a/src/cli/_template/something-delete.ts +++ b/src/cli/_template/something-delete.ts @@ -21,11 +21,14 @@ export default function setup() { .addOption( new Option( '-i, --something-id ', - '[Something] id. If specified, -a and -A are ignored.' - ) + '[Something] id. If specified, -a cannot be used.' + ).conflicts(['all']) ) .addOption( - new Option('-a, --all', 'Delete all [somethings]. Ignored with -i.') + new Option( + '-a, --all', + 'Delete all [somethings]. Cannot be used with -i.' + ).conflicts(['somethingId']) ) .addOption( new Option( diff --git a/src/cli/_template/something-else-delete.ts b/src/cli/_template/something-else-delete.ts index 818b705a5..3d55b1f4e 100644 --- a/src/cli/_template/something-else-delete.ts +++ b/src/cli/_template/something-else-delete.ts @@ -21,10 +21,15 @@ export default function setup() { .addOption( new Option( '-i, --else-id ', - '[Else] id. If specified, -a and -A are ignored.' - ) + '[Else] id. If specified, -a cannot be used.' + ).conflicts(['all']) + ) + .addOption( + new Option( + '-a, --all', + 'Delete all [elses]. Cannot be used with -i.' + ).conflicts(['elseId']) ) - .addOption(new Option('-a, --all', 'Delete all [elses]. Ignored with -i.')) .addOption( new Option( '--no-deep', diff --git a/src/cli/_template/something-else-export.ts b/src/cli/_template/something-else-export.ts index da1efba41..a2d2a47fe 100644 --- a/src/cli/_template/something-else-export.ts +++ b/src/cli/_template/something-else-export.ts @@ -21,21 +21,21 @@ export default function setup() { .addOption( new Option( '-i, --else-id ', - '[Else] id. If specified, -a and -A are ignored.' - ) + '[Else] id. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the export file.')) .addOption( new Option( '-a, --all', - 'Export all [else] to a single file. Ignored with -i.' - ) + 'Export all [else] to a single file. Cannot be used with -i or -A.' + ).conflicts(['elseId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Export all [else] to separate files (*.[else].json) in the current directory. Ignored with -i or -a.' - ) + 'Export all [else] to separate files (*.[else].json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['elseId', 'all']) ) .addOption( new Option( diff --git a/src/cli/_template/something-else-import.ts b/src/cli/_template/something-else-import.ts index af35a4894..7c6b486de 100644 --- a/src/cli/_template/something-else-import.ts +++ b/src/cli/_template/something-else-import.ts @@ -21,21 +21,21 @@ export default function setup() { .addOption( new Option( '-i, --else-id ', - '[Else] id. If specified, only one [else] is imported and the options -a and -A are ignored.' - ) + '[Else] id. If specified, only one [else] is imported and the options -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the file to import.')) .addOption( new Option( '-a, --all', - 'Import all [else] from single file. Ignored with -i.' - ) + 'Import all [else] from single file. Cannot be used with -i or -A.' + ).conflicts(['elseId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Import all [else] from separate files (*.[else].json) in the current directory. Ignored with -i or -a.' - ) + 'Import all [else] from separate files (*.[else].json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['elseID', 'all']) ) .addHelpText( 'after', diff --git a/src/cli/_template/something-export.ts b/src/cli/_template/something-export.ts index ff4dafc16..8558eeebc 100644 --- a/src/cli/_template/something-export.ts +++ b/src/cli/_template/something-export.ts @@ -21,21 +21,21 @@ export default function setup() { .addOption( new Option( '-i, --something-id ', - '[Something] id. If specified, -a and -A are ignored.' - ) + '[Something] id. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the export file.')) .addOption( new Option( '-a, --all', - 'Export all [somethings] to a single file. Ignored with -i.' - ) + 'Export all [somethings] to a single file. Cannot be used with -i or -A.' + ).conflicts(['somethingId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Export all [somethings] to separate files (*.[something].json) in the current directory. Ignored with -i or -a.' - ) + 'Export all [somethings] to separate files (*.[something].json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['somethingId', 'all']) ) .addOption( new Option( diff --git a/src/cli/_template/something-import.ts b/src/cli/_template/something-import.ts index 2feaa8f0f..2a480a25d 100644 --- a/src/cli/_template/something-import.ts +++ b/src/cli/_template/something-import.ts @@ -21,21 +21,21 @@ export default function setup() { .addOption( new Option( '-i, --something-id ', - '[Something] id. If specified, only one [something] is imported and the options -a and -A are ignored.' - ) + '[Something] id. If specified, only one [something] is imported and the options -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the file to import.')) .addOption( new Option( '-a, --all', - 'Import all [somethings] from single file. Ignored with -i.' - ) + 'Import all [somethings] from single file. Cannot be used with -i or -A.' + ).conflicts(['somethingId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Import all [something] from separate files (*.[something].json) in the current directory. Ignored with -i or -a.' - ) + 'Import all [something] from separate files (*.[something].json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['somethingId', 'all']) ) .addHelpText( 'after', diff --git a/src/cli/_template/something-other-delete.ts b/src/cli/_template/something-other-delete.ts index 5a62ceb2d..589209697 100644 --- a/src/cli/_template/something-other-delete.ts +++ b/src/cli/_template/something-other-delete.ts @@ -21,10 +21,15 @@ export default function setup() { .addOption( new Option( '-i, --other-id ', - '[Other] id. If specified, -a and -A are ignored.' - ) + '[Other] id. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) + ) + .addOption( + new Option( + '-a, --all', + 'Delete all [others]. Cannot be used with -i.' + ).conflicts(['somethingId']) ) - .addOption(new Option('-a, --all', 'Delete all [others]. Ignored with -i.')) .addOption( new Option( '--no-deep', diff --git a/src/cli/_template/something-other-export.ts b/src/cli/_template/something-other-export.ts index eb965b599..526b39f88 100644 --- a/src/cli/_template/something-other-export.ts +++ b/src/cli/_template/something-other-export.ts @@ -21,21 +21,21 @@ export default function setup() { .addOption( new Option( '-i, --other-id ', - '[Other] id. If specified, -a and -A are ignored.' - ) + '[Other] id. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the export file.')) .addOption( new Option( '-a, --all', - 'Export all [others] to a single file. Ignored with -i.' - ) + 'Export all [others] to a single file. Cannot be used with -i or -A.' + ).conflicts(['otherId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Export all [others] to separate files (*.[other].json) in the current directory. Ignored with -i or -a.' - ) + 'Export all [others] to separate files (*.[other].json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['otherId', 'all']) ) .addOption( new Option( diff --git a/src/cli/_template/something-other-import.ts b/src/cli/_template/something-other-import.ts index 2f078687a..5cfad4447 100644 --- a/src/cli/_template/something-other-import.ts +++ b/src/cli/_template/something-other-import.ts @@ -21,21 +21,21 @@ export default function setup() { .addOption( new Option( '-i, --other-id ', - '[Other] id. If specified, only one [other] is imported and the options -a and -A are ignored.' - ) + '[Other] id. If specified, only one [other] is imported and the options -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the file to import.')) .addOption( new Option( '-a, --all', - 'Import all [others] from single file. Ignored with -i.' - ) + 'Import all [others] from single file. Cannot be used with -i or -A.' + ).conflicts(['otherId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Import all [others] from separate files (*.[other].json) in the current directory. Ignored with -i or -a.' - ) + 'Import all [others] from separate files (*.[other].json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['otherId', 'all']) ) .addHelpText( 'after', diff --git a/src/cli/admin/admin-federation-export.ts b/src/cli/admin/admin-federation-export.ts index 085770f21..e9e467e66 100644 --- a/src/cli/admin/admin-federation-export.ts +++ b/src/cli/admin/admin-federation-export.ts @@ -26,26 +26,26 @@ export default function setup() { .addOption( new Option( '-i, --idp-id ', - 'Id/name of a provider. If specified, -a and -A are ignored.' - ) + 'Id/name of a provider. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption( new Option( '-f, --file [file]', - 'Name of the file to write the exported provider(s) to. Ignored with -A.' - ) + 'Name of the file to write the exported provider(s) to. Cannot be used with -A.' + ).conflicts(['allSeparate']) ) .addOption( new Option( '-a, --all', - 'Export all the providers to a single file. Ignored with -t and -i.' - ) + 'Export all the providers to a single file. Cannot be used with -i or -A.' + ).conflicts(['idpId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Export all the providers as separate files .admin.federation.json. Ignored with -t, -i, and -a.' - ) + 'Export all the providers as separate files .admin.federation.json. Cannot be used with -i or -a.' + ).conflicts(['idpId', 'all']) ) .addOption( new Option( diff --git a/src/cli/admin/admin-federation-import.ts b/src/cli/admin/admin-federation-import.ts index 487e2ad1a..64af539b3 100644 --- a/src/cli/admin/admin-federation-import.ts +++ b/src/cli/admin/admin-federation-import.ts @@ -27,8 +27,8 @@ export default function setup() { .addOption( new Option( '-i, --idp-id ', - 'Provider id. If specified, -a and -A are ignored.' - ) + 'Provider id. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption( new Option( @@ -39,14 +39,14 @@ export default function setup() { .addOption( new Option( '-a, --all', - 'Import all the providers from single file. Ignored with -t or -i.' - ) + 'Import all the providers from single file. Cannot be used with -i or -A.' + ).conflicts(['idpId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Import all the providers from separate files (*.admin.federation.json) in the current directory. Ignored with -t or -i or -a.' - ) + 'Import all the providers from separate files (*.admin.federation.json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['idpId', 'all']) ) .action( // implement command logic inside action handler diff --git a/src/cli/agent/agent-delete.ts b/src/cli/agent/agent-delete.ts index 546a9ff27..7785d4d55 100644 --- a/src/cli/agent/agent-delete.ts +++ b/src/cli/agent/agent-delete.ts @@ -14,10 +14,15 @@ export default function setup() { .addOption( new Option( '-i, --agent-id ', - 'Agent id. If specified, -a is ignored.' - ) + 'Agent id. If specified, -a cannot be used.' + ).conflicts(['all']) + ) + .addOption( + new Option( + '-a, --all', + 'Delete all agents. Cannot be used with -i.' + ).conflicts(['agentId']) ) - .addOption(new Option('-a, --all', 'Delete all agents. Ignored with -i.')) .action( // implement command logic inside action handler async (host, realm, user, password, options, command) => { diff --git a/src/cli/agent/agent-export.ts b/src/cli/agent/agent-export.ts index 05a4a152c..97c6b803e 100644 --- a/src/cli/agent/agent-export.ts +++ b/src/cli/agent/agent-export.ts @@ -21,21 +21,21 @@ export default function setup() { .addOption( new Option( '-i, --agent-id ', - 'Agent id. If specified, -a and -A are ignored.' - ) + 'Agent id. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the export file.')) .addOption( new Option( '-a, --all', - 'Export all agents to a single file. Ignored with -i.' - ) + 'Export all agents to a single file. Cannot be used with -i or -A.' + ).conflicts(['agentId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Export all agents to separate files (*..agent.json) in the current directory. Ignored with -i or -a.' - ) + 'Export all agents to separate files (*..agent.json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['agentId', 'all']) ) .addOption( new Option( diff --git a/src/cli/agent/agent-gateway-delete.ts b/src/cli/agent/agent-gateway-delete.ts index c5b4d1e61..45a55476c 100644 --- a/src/cli/agent/agent-gateway-delete.ts +++ b/src/cli/agent/agent-gateway-delete.ts @@ -17,14 +17,14 @@ export default function setup() { .addOption( new Option( '-i, --agent-id ', - 'Agent id. If specified, -a is ignored.' - ) + 'Agent id. If specified, -a cannot be used.' + ).conflicts(['all']) ) .addOption( new Option( '-a, --all', - 'Delete all identity gateway agents. Ignored with -i.' - ) + 'Delete all identity gateway agents. Cannot be used with -i.' + ).conflicts(['agentId']) ) .action( // implement command logic inside action handler diff --git a/src/cli/agent/agent-gateway-export.ts b/src/cli/agent/agent-gateway-export.ts index 848408039..c475fe69a 100644 --- a/src/cli/agent/agent-gateway-export.ts +++ b/src/cli/agent/agent-gateway-export.ts @@ -17,21 +17,21 @@ export default function setup() { .addOption( new Option( '-i, --agent-id ', - 'Agent id. If specified, -a and -A are ignored.' - ) + 'Agent id. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the export file.')) .addOption( new Option( '-a, --all', - 'Export all gateway agents to a single file. Ignored with -i.' - ) + 'Export all gateway agents to a single file. Cannot be used with -i or -A.' + ).conflicts(['agentId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Export all gateway agents to separate files (*.identitygatewayagent.json) in the current directory. Ignored with -i or -a.' - ) + 'Export all gateway agents to separate files (*.identitygatewayagent.json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['agentId', 'all']) ) .addOption( new Option( diff --git a/src/cli/agent/agent-gateway-import.ts b/src/cli/agent/agent-gateway-import.ts index 98e68907b..ba599d02d 100644 --- a/src/cli/agent/agent-gateway-import.ts +++ b/src/cli/agent/agent-gateway-import.ts @@ -18,21 +18,21 @@ export default function setup() { .addOption( new Option( '-i, --agent-id ', - 'Agent id. If specified, only one agent is imported and the options -a and -A are ignored.' - ) + 'Agent id. If specified, only one agent is imported and the options -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the file to import.')) .addOption( new Option( '-a, --all', - 'Import all agents from single file. Ignored with -i.' - ) + 'Import all agents from single file. Cannot be used with -i or -A.' + ).conflicts(['agentId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Import all agents from separate files (*.identitygatewayagent.json) in the current directory. Ignored with -i or -a.' - ) + 'Import all agents from separate files (*.identitygatewayagent.json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['agentId', 'all']) ) .action( // implement command logic inside action handler diff --git a/src/cli/agent/agent-import.ts b/src/cli/agent/agent-import.ts index e3985dbf7..dadfaaac0 100644 --- a/src/cli/agent/agent-import.ts +++ b/src/cli/agent/agent-import.ts @@ -22,21 +22,21 @@ export default function setup() { .addOption( new Option( '-i, --agent-id ', - 'Agent id. If specified, only one agent is imported and the options -a and -A are ignored.' - ) + 'Agent id. If specified, only one agent is imported and the options -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the file to import.')) .addOption( new Option( '-a, --all', - 'Import all agents from single file. Ignored with -i.' - ) + 'Import all agents from single file. Cannot be used with -i or -A.' + ).conflicts(['agentId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Import all agents from separate files (*.agent.json) in the current directory. Ignored with -i or -a.' - ) + 'Import all agents from separate files (*.agent.json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['agentId', 'all']) ) .addOption(new Option('-g, --global', 'Import global agents.')) .action( diff --git a/src/cli/agent/agent-java-delete.ts b/src/cli/agent/agent-java-delete.ts index a6e209adf..5598603b2 100644 --- a/src/cli/agent/agent-java-delete.ts +++ b/src/cli/agent/agent-java-delete.ts @@ -14,11 +14,14 @@ export default function setup() { .addOption( new Option( '-i, --agent-id ', - 'Agent id. If specified, -a is ignored.' - ) + 'Agent id. If specified, -a cannot be used.' + ).conflicts(['all']) ) .addOption( - new Option('-a, --all', 'Delete all java agents. Ignored with -i.') + new Option( + '-a, --all', + 'Delete all java agents. Cannot be used with -i.' + ).conflicts(['agentId']) ) .action( // implement command logic inside action handler diff --git a/src/cli/agent/agent-java-export.ts b/src/cli/agent/agent-java-export.ts index b6d452092..93f8c5d4c 100644 --- a/src/cli/agent/agent-java-export.ts +++ b/src/cli/agent/agent-java-export.ts @@ -17,21 +17,21 @@ export default function setup() { .addOption( new Option( '-i, --agent-id ', - 'Agent id. If specified, -a and -A are ignored.' - ) + 'Agent id. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the export file.')) .addOption( new Option( '-a, --all', - 'Export all java agents to a single file. Ignored with -i.' - ) + 'Export all java agents to a single file. Cannot be used with -i or -A.' + ).conflicts(['agentId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Export all java agents to separate files (*.javaagent.json) in the current directory. Ignored with -i or -a.' - ) + 'Export all java agents to separate files (*.javaagent.json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['agentId', 'all']) ) .addOption( new Option( diff --git a/src/cli/agent/agent-java-import.ts b/src/cli/agent/agent-java-import.ts index 91aa46418..d4fa213a9 100644 --- a/src/cli/agent/agent-java-import.ts +++ b/src/cli/agent/agent-java-import.ts @@ -18,21 +18,21 @@ export default function setup() { .addOption( new Option( '-i, --agent-id ', - 'Agent id. If specified, only one agent is imported and the options -a and -A are ignored.' - ) + 'Agent id. If specified, only one agent is imported and the options -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the file to import.')) .addOption( new Option( '-a, --all', - 'Import all agents from single file. Ignored with -i.' - ) + 'Import all agents from single file. Cannot be used with -i or -A.' + ).conflicts(['agentId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Import all agents from separate files (*.javaagent.json) in the current directory. Ignored with -i or -a.' - ) + 'Import all agents from separate files (*.javaagent.json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['agentId', 'all']) ) .action( // implement command logic inside action handler diff --git a/src/cli/agent/agent-web-delete.ts b/src/cli/agent/agent-web-delete.ts index fecf3f8a8..f096c175d 100644 --- a/src/cli/agent/agent-web-delete.ts +++ b/src/cli/agent/agent-web-delete.ts @@ -14,11 +14,14 @@ export default function setup() { .addOption( new Option( '-i, --agent-id ', - 'Agent id. If specified, -a and -A are ignored.' - ) + 'Agent id. If specified, -a cannot be used.' + ).conflicts(['all']) ) .addOption( - new Option('-a, --all', 'Delete all web agents. Ignored with -i.') + new Option( + '-a, --all', + 'Delete all web agents. Cannot be used with -i.' + ).conflicts(['agentId']) ) .action( // implement command logic inside action handler diff --git a/src/cli/agent/agent-web-export.ts b/src/cli/agent/agent-web-export.ts index 6c179300d..e282452cb 100644 --- a/src/cli/agent/agent-web-export.ts +++ b/src/cli/agent/agent-web-export.ts @@ -17,21 +17,21 @@ export default function setup() { .addOption( new Option( '-i, --agent-id ', - 'Agent id. If specified, -a and -A are ignored.' - ) + 'Agent id. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the export file.')) .addOption( new Option( '-a, --all', - 'Export all web agents to a single file. Ignored with -i.' - ) + 'Export all web agents to a single file. Cannot be used with -i or -A.' + ).conflicts(['agentId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Export all web agents to separate files (*.webagent.json) in the current directory. Ignored with -i or -a.' - ) + 'Export all web agents to separate files (*.webagent.json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['agentId', 'all']) ) .addOption( new Option( diff --git a/src/cli/agent/agent-web-import.ts b/src/cli/agent/agent-web-import.ts index e24885b63..3165548d6 100644 --- a/src/cli/agent/agent-web-import.ts +++ b/src/cli/agent/agent-web-import.ts @@ -18,21 +18,21 @@ export default function setup() { .addOption( new Option( '-i, --agent-id ', - 'Agent id. If specified, only one agent is imported and the options -a and -A are ignored.' - ) + 'Agent id. If specified, only one agent is imported and the options -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the file to import.')) .addOption( new Option( '-a, --all', - 'Import all agents from single file. Ignored with -i.' - ) + 'Import all agents from single file. Cannot be used with -i or -A.' + ).conflicts(['agentId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Import all agents from separate files (*.webagent.json) in the current directory. Ignored with -i or -a.' - ) + 'Import all agents from separate files (*.webagent.json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['agentId', 'all']) ) .action( // implement command logic inside action handler diff --git a/src/cli/app/app-delete.ts b/src/cli/app/app-delete.ts index 0e202d361..d68dbb29d 100644 --- a/src/cli/app/app-delete.ts +++ b/src/cli/app/app-delete.ts @@ -26,17 +26,20 @@ export default function setup() { .addOption( new Option( '-i, --app-id ', - 'Application id. If specified, -n and -a are ignored.' - ) + 'Application id. If specified, -n and -a cannot be used.' + ).conflicts(['appName', 'all']) ) .addOption( new Option( '-n, --app-name ', - 'Application name. If specified, -a is ignored.' - ) + 'Application name. If specified, -a cannot be used.' + ).conflicts(['all']) ) .addOption( - new Option('-a, --all', 'Delete all applications. Ignored with -i or -n.') + new Option( + '-a, --all', + 'Delete all applications. Cannot be used with -i or -n.' + ).conflicts(['appId', 'appName']) ) .addOption( new Option( diff --git a/src/cli/app/app-describe.ts b/src/cli/app/app-describe.ts index 05c0852f7..44e62d009 100644 --- a/src/cli/app/app-describe.ts +++ b/src/cli/app/app-describe.ts @@ -21,8 +21,8 @@ export default function setup() { .addOption( new Option( '-i, --app-id ', - 'Application id. If specified, -n is ignored.' - ) + 'Application id. If specified, -n cannot be used.' + ).conflicts(['appName']) ) .addOption(new Option('-n, --app-name ', 'Application name.')) .addHelpText( diff --git a/src/cli/app/app-export.ts b/src/cli/app/app-export.ts index 1b93d3505..b0f19060a 100644 --- a/src/cli/app/app-export.ts +++ b/src/cli/app/app-export.ts @@ -27,27 +27,27 @@ export default function setup() { .addOption( new Option( '-i, --app-id ', - 'Application id. If specified, -n, -a, and -A are ignored.' - ) + 'Application id. If specified, -n, -a, and -A cannot be used.' + ).conflicts(['appName', 'all', 'allSeparate']) ) .addOption( new Option( '-n, --app-name ', - 'Application name. If specified, -a and -A are ignored.' - ) + 'Application name. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the export file.')) .addOption( new Option( '-a, --all', - 'Export all applications to a single file. Ignored with -i or -n.' - ) + 'Export all applications to a single file. Cannot be used with -i, -n, or -A.' + ).conflicts(['appId', 'appName', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Export all applications to separate files (*.application.json) in the current directory. Ignored with -i, -n, or -a.' - ) + 'Export all applications to separate files (*.application.json) in the current directory. Cannot be used with -i, -n, or -a.' + ).conflicts(['appId', 'appName', 'all']) ) .addOption( new Option( diff --git a/src/cli/app/app-import.ts b/src/cli/app/app-import.ts index aac23edc7..289b775d9 100644 --- a/src/cli/app/app-import.ts +++ b/src/cli/app/app-import.ts @@ -28,27 +28,27 @@ export default function setup() { .addOption( new Option( '-i, --app-id ', - 'Application id. If specified, only one application is imported and the options -n, -a, and -A are ignored.' - ) + 'Application id. If specified, only one application is imported and the options -n, -a, and -A cannot be used.' + ).conflicts(['appName', 'all', 'allSeparate']) ) .addOption( new Option( '-n, --app-name ', - 'Application name. If specified, only one application is imported and the options -a and -A are ignored.' - ) + 'Application name. If specified, only one application is imported and the options -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the file to import.')) .addOption( new Option( '-a, --all', - 'Import all applications from single file. Ignored with -i or -n.' - ) + 'Import all applications from single file. Cannot be used with -i, -n, or -A.' + ).conflicts(['appId', 'appName', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Import all applications from separate files (*.app.json) in the current directory. Ignored with -i, -n, or -a.' - ) + 'Import all applications from separate files (*.app.json) in the current directory. Cannot be used with -i, -n, or -a.' + ).conflicts(['appName', 'appName', 'all']) ) .addOption( new Option('--no-deps', 'Do not include any dependencies (scripts).') diff --git a/src/cli/authz/authz-policy-delete.ts b/src/cli/authz/authz-policy-delete.ts index 7e29dd2ce..601e761eb 100644 --- a/src/cli/authz/authz-policy-delete.ts +++ b/src/cli/authz/authz-policy-delete.ts @@ -17,17 +17,20 @@ export default function setup() { .addOption( new Option( '-i, --policy-id ', - 'Policy id/name. If specified, -a is ignored.' - ) + 'Policy id/name. If specified, -a cannot be used.' + ).conflicts(['all']) ) .addOption( new Option( '-a, --all', - 'Delete all policies in a realm. Ignored with -i.' - ) + 'Delete all policies in a realm. Cannot be used with -i.' + ).conflicts(['policyId']) ) .addOption( - new Option('--set-id ', 'Policy set id/name. Ignored with -i.') + new Option( + '--set-id ', + 'Policy set id/name. Cannot be used with -i.' + ).conflicts(['policyId']) ) .action( // implement command logic inside action handler diff --git a/src/cli/authz/authz-policy-export.ts b/src/cli/authz/authz-policy-export.ts index 353cad036..6f8b8160a 100644 --- a/src/cli/authz/authz-policy-export.ts +++ b/src/cli/authz/authz-policy-export.ts @@ -19,27 +19,27 @@ export default function setup() { .addOption( new Option( '-i, --policy-id ', - 'Policy id. If specified, -a and -A are ignored.' - ) + 'Policy id. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption( new Option( '--set-id ', - 'Export policies in policy set only. Ignored with -i.' - ) + 'Export policies in policy set only. Cannot be used with -i.' + ).conflicts(['policyId']) ) .addOption(new Option('-f, --file ', 'Name of the export file.')) .addOption( new Option( '-a, --all', - 'Export policies to a single file. Ignored with -i.' - ) + 'Export policies to a single file. Cannot be used with -i or -A.' + ).conflicts(['policyId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Export policies to separate files (*.policy.authz.json) in the current directory. Ignored with -i or -a.' - ) + 'Export policies to separate files (*.policy.authz.json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['policyId', 'all']) ) .addOption( new Option( diff --git a/src/cli/authz/authz-policy-import.ts b/src/cli/authz/authz-policy-import.ts index f1464a33e..17abcd52b 100644 --- a/src/cli/authz/authz-policy-import.ts +++ b/src/cli/authz/authz-policy-import.ts @@ -18,8 +18,8 @@ export default function setup() { .addOption( new Option( '-i, --policy-id ', - 'Policy id. If specified, only one policy is imported and the options -a and -A are ignored.' - ) + 'Policy id. If specified, only one policy is imported and the options -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption( new Option('--set-id ', 'Import policies into this policy set.') @@ -28,14 +28,14 @@ export default function setup() { .addOption( new Option( '-a, --all', - 'Import all policies from single file. Ignored with -i.' - ) + 'Import all policies from single file. Cannot be used with -i or -A.' + ).conflicts(['policyId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Import all policies from separate files (*.policy.authz.json) in the current directory. Ignored with -i or -a.' - ) + 'Import all policies from separate files (*.policy.authz.json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['policyId', 'all']) ) .addOption( new Option( diff --git a/src/cli/authz/authz-set-delete.ts b/src/cli/authz/authz-set-delete.ts index 2aa2112ed..52b7ad731 100644 --- a/src/cli/authz/authz-set-delete.ts +++ b/src/cli/authz/authz-set-delete.ts @@ -10,12 +10,17 @@ export default function setup() { program .description('Delete authorization policy sets.') - .addOption(new Option('-i, --set-id ', 'Policy set id/name.')) + .addOption( + new Option( + '-i, --set-id ', + 'Policy set id/name. Cannot be used with -a' + ).conflicts(['all']) + ) .addOption( new Option( '-a, --all', - 'Delete all policy sets in a realm. Ignored with -i.' - ) + 'Delete all policy sets in a realm. Cannot be used with -i.' + ).conflicts(['setId']) ) .action( // implement command logic inside action handler diff --git a/src/cli/authz/authz-set-export.ts b/src/cli/authz/authz-set-export.ts index c8152f1f2..1b6777112 100644 --- a/src/cli/authz/authz-set-export.ts +++ b/src/cli/authz/authz-set-export.ts @@ -17,21 +17,21 @@ export default function setup() { .addOption( new Option( '-i, --set-id ', - 'Policy set id/name. If specified, -a and -A are ignored.' - ) + 'Policy set id/name. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the export file.')) .addOption( new Option( '-a, --all', - 'Export all applications/policy sets to a single file. Ignored with -i.' - ) + 'Export all applications/policy sets to a single file. Cannot be used with -i or -A.' + ).conflicts(['setId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Export all applications/policy sets to separate files (*.authz.json) in the current directory. Ignored with -i or -a.' - ) + 'Export all applications/policy sets to separate files (*.authz.json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['setId', 'all']) ) .addOption( new Option( diff --git a/src/cli/authz/authz-set-import.ts b/src/cli/authz/authz-set-import.ts index 1c1d7ed0f..0fabbb27c 100644 --- a/src/cli/authz/authz-set-import.ts +++ b/src/cli/authz/authz-set-import.ts @@ -18,21 +18,21 @@ export default function setup() { .addOption( new Option( '-i, --set-id ', - 'Policy set id/name. If specified, only one policy set is imported and the options -a and -A are ignored.' - ) + 'Policy set id/name. If specified, only one policy set is imported and the options -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the file to import.')) .addOption( new Option( '-a, --all', - 'Import all policy sets from single file. Ignored with -i.' - ) + 'Import all policy sets from single file. Cannot be used with -i or -A.' + ).conflicts(['setId', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Import all policy sets from separate files (*.policyset.authz.json) in the current directory. Ignored with -i or -a.' - ) + 'Import all policy sets from separate files (*.policyset.authz.json) in the current directory. Cannot be used with -i or -a.' + ).conflicts(['setId', 'all']) ) .addOption( new Option( diff --git a/src/cli/authz/authz-type-delete.ts b/src/cli/authz/authz-type-delete.ts index bb6bcc506..6d9aae51a 100644 --- a/src/cli/authz/authz-type-delete.ts +++ b/src/cli/authz/authz-type-delete.ts @@ -17,20 +17,20 @@ export default function setup() { .addOption( new Option( '-i, --type-id ', - 'Variable id. If specified, -a is ignored.' - ) + 'Variable id. If specified, -n or -a cannot be used.' + ).conflicts(['all', 'typeName']) ) .addOption( new Option( '-n, --type-name ', - 'Resource type name. If specified, -a is ignored.' - ) + 'Resource type name. If specified, -i and -a cannot be used.' + ).conflicts(['typeId', 'all']) ) .addOption( new Option( '-a, --all', - 'Delete all resource types in a realm. Ignored with -i and -n.' - ) + 'Delete all resource types in a realm. Cannot be used with -i and -n.' + ).conflicts(['typeId', 'typeName']) ) .action( // implement command logic inside action handler diff --git a/src/cli/authz/authz-type-describe.ts b/src/cli/authz/authz-type-describe.ts index a9414a1f0..bcb02c0be 100644 --- a/src/cli/authz/authz-type-describe.ts +++ b/src/cli/authz/authz-type-describe.ts @@ -13,8 +13,18 @@ export default function setup() { program .description('Describe authorization resource types.') - .addOption(new Option('-i, --type-id ', 'Resource type uuid.')) - .addOption(new Option('-n, --type-name ', 'Resource type name.')) + .addOption( + new Option( + '-i, --type-id ', + 'Resource type uuid. Cannot be used with -n' + ).conflicts(['typeName']) + ) + .addOption( + new Option( + '-n, --type-name ', + 'Resource type name. Cannot be used with -i' + ).conflicts(['typeId']) + ) .addOption(new Option('--json', 'Output in JSON format.')) .action( // implement command logic inside action handler diff --git a/src/cli/authz/authz-type-export.ts b/src/cli/authz/authz-type-export.ts index 7ab91f2f5..b650f905a 100644 --- a/src/cli/authz/authz-type-export.ts +++ b/src/cli/authz/authz-type-export.ts @@ -18,27 +18,27 @@ export default function setup() { .addOption( new Option( '-i, --type-id ', - 'Resource type uuid. If specified, -a and -A are ignored.' - ) + 'Resource type uuid. If specified, -n, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption( new Option( '-n, --type-name ', - 'Resource type name. If specified, -a and -A are ignored.' - ) + 'Resource type name. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the export file.')) .addOption( new Option( '-a, --all', - 'Export all resource types to a single file. Ignored with -i.' - ) + 'Export all resource types to a single file. Cannot be used with -i, -n or -A.' + ).conflicts(['typeId', 'typeName', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Export all resource types to separate files (*.resourcetype.authz.json) in the current directory. Ignored with -i, -n, or -a.' - ) + 'Export all resource types to separate files (*.resourcetype.authz.json) in the current directory. Cannot be used with -i, -n, or -a.' + ).conflicts(['typeId', 'typeName', 'all']) ) .addOption( new Option( diff --git a/src/cli/authz/authz-type-import.ts b/src/cli/authz/authz-type-import.ts index 0d02565c7..a3b98f6b4 100644 --- a/src/cli/authz/authz-type-import.ts +++ b/src/cli/authz/authz-type-import.ts @@ -19,27 +19,27 @@ export default function setup() { .addOption( new Option( '-i, --type-id ', - 'Resource type uuid. If specified, -a and -A are ignored.' - ) + 'Resource type uuid. If specified, -n, -a and -A cannot be used.' + ).conflicts(['typeName', 'all', 'allSeparate']) ) .addOption( new Option( '-n, --type-name ', - 'Resource type name. If specified, -a and -A are ignored.' - ) + 'Resource type name. If specified, -a and -A cannot be used.' + ).conflicts(['all', 'allSeparate']) ) .addOption(new Option('-f, --file ', 'Name of the file to import.')) .addOption( new Option( '-a, --all', - 'Import all resource types from single file. Ignored with -i.' - ) + 'Import all resource types from single file. Cannot be used with -i, -n or -A.' + ).conflicts(['typeId', 'typeName', 'allSeparate']) ) .addOption( new Option( '-A, --all-separate', - 'Import all resource types from separate files (*.resourcetype.authz.json) in the current directory. Ignored with -i, -n, or -a.' - ) + 'Import all resource types from separate files (*.resourcetype.authz.json) in the current directory. Cannot be used with -i, -n, or -a.' + ).conflicts(['typeId', 'typeName', 'all']) ) .action( // implement command logic inside action handler diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull-authz-policies.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull-authz-policies.ts index 639c70cf8..f14afb8e6 100644 --- a/src/cli/config-manager/config-manager-pull/config-manager-pull-authz-policies.ts +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull-authz-policies.ts @@ -32,8 +32,8 @@ export default function setup() { .addOption( new Option( '-r, --realm ', - 'Specifies the realm to export from. Only policy sets from this realm will be exported. Ignored with -f' - ) + 'Specifies the realm to export from. Only policy sets from this realm will be exported. Cannot be used with -f' + ).conflicts(['file']) ) .addOption( new Option( diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull-scripts.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull-scripts.ts index 3beb7f298..f1070ff88 100644 --- a/src/cli/config-manager/config-manager-pull/config-manager-pull-scripts.ts +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull-scripts.ts @@ -44,33 +44,33 @@ export default function setup() { .addOption( new Option( '-p, --prefix ', - 'Export all scripts that start with a certain prefix. Ignored with -n' - ) + 'Export all scripts that start with a certain prefix. Cannot be used with -n' + ).conflicts(['scriptName']) ) .addOption( new Option( '--just-content', - 'Export only the script .js files, no config files' - ) + 'Export only the script .js files. Cannot be used with --just-config.' + ).conflicts(['justConfig']) ) .addOption( new Option( '--just-config', - 'Export only the config .json files, no scripts. Ignored with --just-content' - ) + 'Export only the config .json files, no scripts. Cannot be used with --just-content' + ).conflicts(['justContent']) ) .addOption( new Option( '--script-type