Skip to content

Commit

Permalink
feat: rename scan parameter to scanId (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
SevenWhite authored Dec 4, 2024
1 parent bea99f5 commit e30ed72
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/Commands/PollingScanStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Arguments, Argv, CommandModule } from 'yargs';
import { container } from 'tsyringe';

export class PollingScanStatus implements CommandModule {
public readonly command = 'scan:polling [options] <scan>';
public readonly command = 'scan:polling [options] <scanId>';
public readonly describe = 'Allows to configure a polling of scan status.';

public builder(argv: Argv): Argv {
Expand Down Expand Up @@ -42,7 +42,7 @@ export class PollingScanStatus implements CommandModule {
requiresArg: true,
default: BreakpointType.ANY
})
.positional('scan', {
.positional('scanId', {
describe: 'ID of an existing scan which you want to check.',
type: 'string',
demandOption: true
Expand All @@ -64,7 +64,7 @@ export class PollingScanStatus implements CommandModule {
try {
const pollingFactory = container.resolve<PollingFactory>(PollingFactory);
const polling = pollingFactory.create({
scanId: args.scan as string,
scanId: args.scanId as string,
timeout: args.timeout as number,
interval: args.interval as number,
breakpoint: args.breakpoint as BreakpointType
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/RetestScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Arguments, Argv, CommandModule } from 'yargs';
import { container } from 'tsyringe';

export class RetestScan implements CommandModule {
public readonly command = 'scan:retest [options] <scan>';
public readonly command = 'scan:retest [options] <scanId>';
public readonly describe =
'Request to start a new scan using the same configuration as an existing scan, by scan ID.';

Expand All @@ -16,7 +16,7 @@ export class RetestScan implements CommandModule {
requiresArg: true,
demandOption: true
})
.positional('scan', {
.positional('scanId', {
describe: 'ID of an existing scan which you want to re-run.',
type: 'string',
demandOption: true
Expand All @@ -37,7 +37,7 @@ export class RetestScan implements CommandModule {
public async handler(args: Arguments): Promise<void> {
try {
const scanManager: Scans = container.resolve(Scans);
const scanId: string = await scanManager.retest(args.scan as string);
const scanId: string = await scanManager.retest(args.scanId as string);

// eslint-disable-next-line no-console
console.log(scanId);
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/StopScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Arguments, Argv, CommandModule } from 'yargs';
import { container } from 'tsyringe';

export class StopScan implements CommandModule {
public readonly command = 'scan:stop [options] <scan>';
public readonly command = 'scan:stop [options] <scanId>';
public readonly describe = 'Stop scan by id.';

public builder(argv: Argv): Argv {
Expand All @@ -15,7 +15,7 @@ export class StopScan implements CommandModule {
requiresArg: true,
demandOption: true
})
.positional('scan', {
.positional('scanId', {
describe: 'ID of an existing scan which you want to stop.',
requiresArg: true,
demandOption: true,
Expand All @@ -38,7 +38,7 @@ export class StopScan implements CommandModule {
try {
const scanManager: Scans = container.resolve(Scans);

await scanManager.stop(args.scan as string);
await scanManager.stop(args.scanId as string);

process.exit(0);
} catch (error) {
Expand Down

0 comments on commit e30ed72

Please sign in to comment.