From a08cdae707104e7008e713d7833bc6b5adfee2d1 Mon Sep 17 00:00:00 2001 From: Peter van der Zee Date: Mon, 7 Apr 2025 16:35:52 +0200 Subject: [PATCH] Polish the usage hints in help in some cases --- src/commands/report/cmd-report-create.ts | 16 ++-------------- src/commands/report/cmd-report-view.ts | 5 ++--- src/commands/repos/cmd-repos-create.test.ts | 2 +- src/commands/repos/cmd-repos-create.ts | 2 +- src/commands/repos/cmd-repos-update.test.ts | 2 +- src/commands/repos/cmd-repos-update.ts | 2 +- src/commands/repos/cmd-repos-view.test.ts | 2 +- src/commands/repos/cmd-repos-view.ts | 2 +- src/commands/scan/cmd-scan-metadata.test.ts | 2 +- src/commands/scan/cmd-scan-metadata.ts | 2 +- 10 files changed, 12 insertions(+), 25 deletions(-) diff --git a/src/commands/report/cmd-report-create.ts b/src/commands/report/cmd-report-create.ts index caa2c9dbb..2ec7458b5 100644 --- a/src/commands/report/cmd-report-create.ts +++ b/src/commands/report/cmd-report-create.ts @@ -1,6 +1,6 @@ import { logger } from '@socketsecurity/registry/lib/logger' -import { commonFlags, outputFlags, validationFlags } from '../../flags' +import { commonFlags, outputFlags } from '../../flags' import { meowOrExit } from '../../utils/meow-with-subcommands' import type { CliCommandConfig } from '../../utils/meow-with-subcommands' @@ -11,19 +11,7 @@ const config: CliCommandConfig = { hidden: false, flags: { ...commonFlags, - ...outputFlags, - ...validationFlags, - dryRun: { - type: 'boolean', - default: false, - description: 'Only output what will be done without actually doing it' - }, - view: { - type: 'boolean', - shortFlag: 'v', - default: false, - description: 'Will wait for and return the created report' - } + ...outputFlags }, help: () => ` This command is deprecated in favor of \`socket scan view\`. diff --git a/src/commands/report/cmd-report-view.ts b/src/commands/report/cmd-report-view.ts index ca6c1b58d..5d33890af 100644 --- a/src/commands/report/cmd-report-view.ts +++ b/src/commands/report/cmd-report-view.ts @@ -1,6 +1,6 @@ import { logger } from '@socketsecurity/registry/lib/logger' -import { commonFlags, outputFlags, validationFlags } from '../../flags' +import { commonFlags, outputFlags } from '../../flags' import { meowOrExit } from '../../utils/meow-with-subcommands' import type { CliCommandConfig } from '../../utils/meow-with-subcommands' @@ -11,8 +11,7 @@ const config: CliCommandConfig = { hidden: false, flags: { ...commonFlags, - ...outputFlags, - ...validationFlags + ...outputFlags }, help: () => ` This command is deprecated in favor of \`socket scan view\`. diff --git a/src/commands/repos/cmd-repos-create.test.ts b/src/commands/repos/cmd-repos-create.test.ts index 63af91f9e..9fad8f1b0 100644 --- a/src/commands/repos/cmd-repos-create.test.ts +++ b/src/commands/repos/cmd-repos-create.test.ts @@ -21,7 +21,7 @@ describe('socket repos create', async () => { "Create a repository in an organization Usage - $ socket repos create + $ socket repos create --repo-name= API Token Requirements - Quota: 1 unit diff --git a/src/commands/repos/cmd-repos-create.ts b/src/commands/repos/cmd-repos-create.ts index 85fb5e031..ab8ad35cb 100644 --- a/src/commands/repos/cmd-repos-create.ts +++ b/src/commands/repos/cmd-repos-create.ts @@ -52,7 +52,7 @@ const config: CliCommandConfig = { }, help: (command, config) => ` Usage - $ ${command} + $ ${command} --repo-name= API Token Requirements - Quota: 1 unit diff --git a/src/commands/repos/cmd-repos-update.test.ts b/src/commands/repos/cmd-repos-update.test.ts index 026ad07a1..9183e0a41 100644 --- a/src/commands/repos/cmd-repos-update.test.ts +++ b/src/commands/repos/cmd-repos-update.test.ts @@ -21,7 +21,7 @@ describe('socket repos update', async () => { "Update a repository in an organization Usage - $ socket repos update + $ socket repos update --repo-name= API Token Requirements - Quota: 1 unit diff --git a/src/commands/repos/cmd-repos-update.ts b/src/commands/repos/cmd-repos-update.ts index 757148957..ca74a1618 100644 --- a/src/commands/repos/cmd-repos-update.ts +++ b/src/commands/repos/cmd-repos-update.ts @@ -52,7 +52,7 @@ const config: CliCommandConfig = { }, help: (command, config) => ` Usage - $ ${command} + $ ${command} --repo-name= API Token Requirements - Quota: 1 unit diff --git a/src/commands/repos/cmd-repos-view.test.ts b/src/commands/repos/cmd-repos-view.test.ts index de8f8656c..5712f89f9 100644 --- a/src/commands/repos/cmd-repos-view.test.ts +++ b/src/commands/repos/cmd-repos-view.test.ts @@ -21,7 +21,7 @@ describe('socket repos view', async () => { "View repositories in an organization Usage - $ socket repos view + $ socket repos view --repo-name= API Token Requirements - Quota: 1 unit diff --git a/src/commands/repos/cmd-repos-view.ts b/src/commands/repos/cmd-repos-view.ts index 48fa8d9a6..431d0ea01 100644 --- a/src/commands/repos/cmd-repos-view.ts +++ b/src/commands/repos/cmd-repos-view.ts @@ -28,7 +28,7 @@ const config: CliCommandConfig = { }, help: (command, config) => ` Usage - $ ${command} + $ ${command} --repo-name= API Token Requirements - Quota: 1 unit diff --git a/src/commands/scan/cmd-scan-metadata.test.ts b/src/commands/scan/cmd-scan-metadata.test.ts index 47f259e7c..8394a5783 100644 --- a/src/commands/scan/cmd-scan-metadata.test.ts +++ b/src/commands/scan/cmd-scan-metadata.test.ts @@ -21,7 +21,7 @@ describe('socket scan metadata', async () => { "Get a scan's metadata Usage - $ socket scan metadata + $ socket scan metadata API Token Requirements - Quota: 1 unit diff --git a/src/commands/scan/cmd-scan-metadata.ts b/src/commands/scan/cmd-scan-metadata.ts index 6a291d458..9dd13614d 100644 --- a/src/commands/scan/cmd-scan-metadata.ts +++ b/src/commands/scan/cmd-scan-metadata.ts @@ -26,7 +26,7 @@ const config: CliCommandConfig = { }, help: (command, config) => ` Usage - $ ${command} + $ ${command} API Token Requirements - Quota: 1 unit