-
Notifications
You must be signed in to change notification settings - Fork 2
Feature: Adding .conflicts() where applicable to make flags exclusive #104
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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']) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing file |
||
| ) | ||
| .addOption( | ||
| new Option( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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.')) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing allSeparate |
||
| .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']) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing file |
||
| ) | ||
| .addHelpText( | ||
| 'after', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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.')) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing allSeparate |
||
| .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']) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing file |
||
| ) | ||
| .addOption( | ||
| new Option( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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.')) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing allSeparate |
||
| .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']) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing file |
||
| ) | ||
| .addHelpText( | ||
| 'after', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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']) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no allSepararte for this command |
||
| ) | ||
| .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', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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.')) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing allSeparate |
||
| .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']) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing file |
||
| ) | ||
| .addOption( | ||
| new Option( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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.')) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing allSeparate |
||
| .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']) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing file |
||
| ) | ||
| .addHelpText( | ||
| 'after', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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']) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing file |
||
| ) | ||
| .addOption( | ||
| new Option( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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( | ||
|
|
@@ -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']) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing file |
||
| ) | ||
| .action( | ||
| // implement command logic inside action handler | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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.')) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing allSeparate |
||
| .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']) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing file |
||
| ) | ||
| .addOption( | ||
| new Option( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing allSeparate