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

SKYOPS-54405 - Fix default taget by using inspectCommandFlags #50

Merged
merged 1 commit into from
Sep 28, 2023
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
4 changes: 2 additions & 2 deletions src/commands/aem/rde/inspect/inventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
'use strict';

const { cli, commonFlags } = require('../../../../lib/base-command');
const { cli } = require('../../../../lib/base-command');
const {
logInJsonArrayFormat,
InspectBaseCommand,
Expand Down Expand Up @@ -89,7 +89,7 @@ Object.assign(InventoryCommand, {
},
],
flags: {
target: commonFlags.target,
target: inspectCommonFlags.target,
include: inspectCommonFlags.include,
output: inspectCommonFlags.output,
},
Expand Down
9 changes: 6 additions & 3 deletions src/commands/aem/rde/inspect/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
*/
'use strict';

const { cli, Flags, commonFlags } = require('../../../../lib/base-command');
const { InspectBaseCommand } = require('../../../../lib/inspect-base-command');
const { cli, Flags } = require('../../../../lib/base-command');
const {
InspectBaseCommand,
inspectCommonFlags,
} = require('../../../../lib/inspect-base-command');

class LogsCommand extends InspectBaseCommand {
async run() {
Expand Down Expand Up @@ -133,7 +136,7 @@ Object.assign(LogsCommand, {
description:
'Get the list of logs for the target of a rapid development environment.',
flags: {
target: commonFlags.target,
target: inspectCommonFlags.target,
format: Flags.string({
char: 'f',
description: `Specify the format string. eg: '%d{dd.MM.yyyy HH:mm:ss.SSS} *%level* [%thread] %logger %msg%n`,
Expand Down
4 changes: 2 additions & 2 deletions src/commands/aem/rde/inspect/osgi-bundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
'use strict';

const { cli, commonFlags } = require('../../../../lib/base-command');
const { cli } = require('../../../../lib/base-command');
const {
InspectBaseCommand,
inspectCommonFlags,
Expand Down Expand Up @@ -103,7 +103,7 @@ Object.assign(OsgiBundlesCommand, {
},
],
flags: {
target: commonFlags.target,
target: inspectCommonFlags.target,
scope: inspectCommonFlags.scope,
include: inspectCommonFlags.include,
output: inspectCommonFlags.output,
Expand Down
4 changes: 2 additions & 2 deletions src/commands/aem/rde/inspect/osgi-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
'use strict';

const { cli, commonFlags } = require('../../../../lib/base-command');
const { cli } = require('../../../../lib/base-command');
const {
InspectBaseCommand,
inspectCommonFlags,
Expand Down Expand Up @@ -98,7 +98,7 @@ Object.assign(OsgiComponentsCommand, {
},
],
flags: {
target: commonFlags.target,
target: inspectCommonFlags.target,
scope: inspectCommonFlags.scope,
include: inspectCommonFlags.include,
output: inspectCommonFlags.output,
Expand Down
4 changes: 2 additions & 2 deletions src/commands/aem/rde/inspect/osgi-configurations.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
'use strict';

const { cli, commonFlags } = require('../../../../lib/base-command');
const { cli } = require('../../../../lib/base-command');
const {
InspectBaseCommand,
inspectCommonFlags,
Expand Down Expand Up @@ -85,7 +85,7 @@ Object.assign(OsgiConfigurationsCommand, {
},
],
flags: {
target: commonFlags.target,
target: inspectCommonFlags.target,
scope: inspectCommonFlags.scope,
include: inspectCommonFlags.include,
output: inspectCommonFlags.output,
Expand Down
4 changes: 2 additions & 2 deletions src/commands/aem/rde/inspect/osgi-services.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
'use strict';

const { cli, commonFlags } = require('../../../../lib/base-command');
const { cli } = require('../../../../lib/base-command');
const {
InspectBaseCommand,
inspectCommonFlags,
Expand Down Expand Up @@ -96,7 +96,7 @@ Object.assign(OsgiServicesCommand, {
},
],
flags: {
target: commonFlags.target,
target: inspectCommonFlags.target,
scope: inspectCommonFlags.scope,
include: inspectCommonFlags.include,
output: inspectCommonFlags.output,
Expand Down
5 changes: 3 additions & 2 deletions src/commands/aem/rde/inspect/request-logs/disable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
*/
'use strict';

const { cli, commonFlags } = require('../../../../../lib/base-command');
const { cli } = require('../../../../../lib/base-command');
const {
InspectBaseCommand,
inspectCommonFlags,
} = require('../../../../../lib/inspect-base-command');

class DisableRequestLogsCommand extends InspectBaseCommand {
Expand All @@ -37,7 +38,7 @@ class DisableRequestLogsCommand extends InspectBaseCommand {
Object.assign(DisableRequestLogsCommand, {
description: 'Disable request logging.',
flags: {
target: commonFlags.target,
target: inspectCommonFlags.target,
},
});

Expand Down
5 changes: 3 additions & 2 deletions src/commands/aem/rde/inspect/request-logs/enable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
*/
'use strict';

const { cli, Flags, commonFlags } = require('../../../../../lib/base-command');
const { cli, Flags } = require('../../../../../lib/base-command');
const {
InspectBaseCommand,
inspectCommonFlags,
} = require('../../../../../lib/inspect-base-command');

class EnableRequestLogsCommand extends InspectBaseCommand {
Expand Down Expand Up @@ -70,7 +71,7 @@ class EnableRequestLogsCommand extends InspectBaseCommand {
Object.assign(EnableRequestLogsCommand, {
description: 'Enable request logging or update the configuration.',
flags: {
target: commonFlags.target,
target: inspectCommonFlags.target,
format: Flags.string({
char: 'f',
description: `Specify the format string. eg: '%d{dd.MM.yyyy HH:mm:ss.SSS} *%level* [%thread] %logger %msg%n`,
Expand Down
4 changes: 2 additions & 2 deletions src/commands/aem/rde/inspect/request-logs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
'use strict';

const { cli, commonFlags } = require('../../../../../lib/base-command');
const { cli } = require('../../../../../lib/base-command');
const {
logInJsonArrayFormat,
InspectBaseCommand,
Expand Down Expand Up @@ -92,7 +92,7 @@ Object.assign(RequestLogsCommand, {
},
],
flags: {
target: commonFlags.target,
target: inspectCommonFlags.target,
include: inspectCommonFlags.include,
output: inspectCommonFlags.output,
},
Expand Down
4 changes: 2 additions & 2 deletions src/commands/aem/rde/inspect/sling-requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
'use strict';

const { commonFlags, cli } = require('../../../../lib/base-command');
const { cli } = require('../../../../lib/base-command');
const {
inspectCommonFlags,
InspectBaseCommand,
Expand Down Expand Up @@ -96,7 +96,7 @@ Object.assign(SlingRequestsCommand, {
},
],
flags: {
target: commonFlags.target,
target: inspectCommonFlags.target,
include: inspectCommonFlags.include,
output: inspectCommonFlags.output,
},
Expand Down
6 changes: 3 additions & 3 deletions src/lib/base-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ module.exports = {
}),
target: Flags.string({
char: 's',
description: "The target instance type. Default 'author'.",
description:
"The target instance type; one of 'author' or 'publish'. If not specified, deployments target both 'author' and 'publish' instances.",
multiple: false,
required: true,
required: false,
options: ['author', 'publish'],
default: 'author',
common: true,
}),
},
Expand Down