Skip to content
Open
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
15 changes: 7 additions & 8 deletions src/cli/FrodoCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,14 @@ 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
? // @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,
helpGroupHeading: option.helpGroupHeading,
});

setStabilityMetadata(cloned, getStabilityMetadata(option));
Expand Down
9 changes: 6 additions & 3 deletions src/cli/_template/something-delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ export default function setup() {
.addOption(
new Option(
'-i, --something-id <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(
Expand Down
11 changes: 8 additions & 3 deletions src/cli/_template/something-else-delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ export default function setup() {
.addOption(
new Option(
'-i, --else-id <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',
Expand Down
12 changes: 6 additions & 6 deletions src/cli/_template/something-else-export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ export default function setup() {
.addOption(
new Option(
'-i, --else-id <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 <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(
Expand Down
12 changes: 6 additions & 6 deletions src/cli/_template/something-else-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ export default function setup() {
.addOption(
new Option(
'-i, --else-id <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 <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',
Expand Down
12 changes: 6 additions & 6 deletions src/cli/_template/something-export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ export default function setup() {
.addOption(
new Option(
'-i, --something-id <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 <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(
Expand Down
12 changes: 6 additions & 6 deletions src/cli/_template/something-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ export default function setup() {
.addOption(
new Option(
'-i, --something-id <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 <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',
Expand Down
11 changes: 8 additions & 3 deletions src/cli/_template/something-other-delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ export default function setup() {
.addOption(
new Option(
'-i, --other-id <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',
Expand Down
12 changes: 6 additions & 6 deletions src/cli/_template/something-other-export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ export default function setup() {
.addOption(
new Option(
'-i, --other-id <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 <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(
Expand Down
12 changes: 6 additions & 6 deletions src/cli/_template/something-other-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ export default function setup() {
.addOption(
new Option(
'-i, --other-id <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 <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',
Expand Down
16 changes: 8 additions & 8 deletions src/cli/admin/admin-federation-export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@ export default function setup() {
.addOption(
new Option(
'-i, --idp-id <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 <provider name>.admin.federation.json. Ignored with -t, -i, and -a.'
)
'Export all the providers as separate files <provider name>.admin.federation.json. Cannot be used with -i or -a.'
).conflicts(['idpId', 'all'])
)
.addOption(
new Option(
Expand Down
12 changes: 6 additions & 6 deletions src/cli/admin/admin-federation-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export default function setup() {
.addOption(
new Option(
'-i, --idp-id <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(
Expand All @@ -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
Expand Down
11 changes: 8 additions & 3 deletions src/cli/agent/agent-delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ export default function setup() {
.addOption(
new Option(
'-i, --agent-id <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) => {
Expand Down
12 changes: 6 additions & 6 deletions src/cli/agent/agent-export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ export default function setup() {
.addOption(
new Option(
'-i, --agent-id <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 <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 (*.<type>.agent.json) in the current directory. Ignored with -i or -a.'
)
'Export all agents to separate files (*.<type>.agent.json) in the current directory. Cannot be used with -i or -a.'
).conflicts(['agentId', 'all'])
)
.addOption(
new Option(
Expand Down
8 changes: 4 additions & 4 deletions src/cli/agent/agent-gateway-delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ export default function setup() {
.addOption(
new Option(
'-i, --agent-id <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
Expand Down
Loading