diff --git a/src/cli/args.ts b/src/cli/args.ts index 9b20a90..f4f6a44 100644 --- a/src/cli/args.ts +++ b/src/cli/args.ts @@ -51,9 +51,9 @@ export function parseArgs(argv: string[]): { continue; } if (arg.startsWith("-")) { - throw new Error(`Unknown option: ${arg}`); + throw new Error(`Unknown option: ${arg} Run \`cve-lite --help\` to see supported options.`); } - throw new Error(`Unexpected argument: ${arg}`); + throw new Error(`Unexpected argument: ${arg} Run \`cve-lite --help\` to see supported options.`); } return { command: "advisories-sync", options }; @@ -67,9 +67,9 @@ export function parseArgs(argv: string[]): { continue; } if (arg.startsWith("-")) { - throw new Error(`Unknown option: ${arg}`); + throw new Error(`Unknown option: ${arg} Run \`cve-lite --help\` to see supported options.`); } - throw new Error(`Unexpected argument: ${arg}`); + throw new Error(`Unexpected argument: ${arg} Run \`cve-lite --help\` to see supported options.`); } return { command: "install-skill", options }; } @@ -267,13 +267,13 @@ export function parseArgs(argv: string[]): { continue; } if (arg.startsWith("-")) { - throw new Error(`Unknown option: ${arg}`); + throw new Error(`Unknown option: ${arg} Run \`cve-lite --help\` to see supported options.`); } if (!projectArg) { projectArg = arg; continue; } - throw new Error(`Unexpected argument: ${arg}`); + throw new Error(`Unexpected argument: ${arg} Run \`cve-lite --help\` to see supported options.`); } if (options.cdx && options.report) { diff --git a/src/index.ts b/src/index.ts index 2c98f3a..89adf17 100644 --- a/src/index.ts +++ b/src/index.ts @@ -74,7 +74,9 @@ try { } catch (error) { const message = error instanceof Error ? error.message : String(error); console.error(chalk.red(`Error: ${message}`)); - console.error(chalk.gray("Run `cve-lite --help` to see supported options.")); + if (!message.includes("--help")) { + console.error(chalk.gray("Run `cve-lite --help` to see supported options.")); + } process.exit(1); }