diff --git a/src/cliproxy/binary/lifecycle.ts b/src/cliproxy/binary/lifecycle.ts index 474a3857..f16b103d 100644 --- a/src/cliproxy/binary/lifecycle.ts +++ b/src/cliproxy/binary/lifecycle.ts @@ -132,9 +132,7 @@ export async function ensureBinary(config: BinaryManagerConfig): Promise return binaryPath; } - // Binary missing - download - log('Binary not found, downloading...', verbose); - + // Binary missing if (!config.allowInstall) { throw new Error( `${getBackendLabel(backend)} binary is not installed locally. ` + @@ -142,6 +140,9 @@ export async function ensureBinary(config: BinaryManagerConfig): Promise ); } + // Only log download intent when a download will actually happen + log('Binary not found, downloading...', verbose); + if (!config.forceVersion) { try { const latestVersion = await fetchLatestVersion(verbose, backend); diff --git a/src/commands/cliproxy/index.ts b/src/commands/cliproxy/index.ts index b580fdda..b0595c62 100644 --- a/src/commands/cliproxy/index.ts +++ b/src/commands/cliproxy/index.ts @@ -146,9 +146,14 @@ export async function handleCliproxyCommand(args: string[]): Promise { const verbose = hasAnyFlag(remainingArgs, ['--verbose', '-v']); const command = remainingArgs[0]; - if (hasAnyFlag(remainingArgs, ['--help', '-h'])) { - await showHelp(); - return; + // Show global cliproxy help only when --help/-h is the top-level intent (no + // subcommand, or the flag is the first arg). Subcommands that accept --help + // (e.g. routing affinity --help) handle it themselves after dispatch. + if (!command || command === '--help' || command === '-h') { + if (hasAnyFlag(remainingArgs, ['--help', '-h'])) { + await showHelp(); + return; + } } // Catalog commands diff --git a/src/commands/cliproxy/pool-subcommand.ts b/src/commands/cliproxy/pool-subcommand.ts index a2758bbe..c19cb269 100644 --- a/src/commands/cliproxy/pool-subcommand.ts +++ b/src/commands/cliproxy/pool-subcommand.ts @@ -79,7 +79,8 @@ export async function handlePoolSubcommand(args: string[]): Promise { console.log(warn(result.message)); process.exitCode = 1; } else if (result.changed) { - console.log(ok(result.message)); + // message already carries the correct [OK]/[!] prefix from routing-strategy + console.log(result.message); } else { console.log(info(result.message)); } @@ -93,7 +94,8 @@ export async function handlePoolSubcommand(args: string[]): Promise { console.log(warn(result.message)); process.exitCode = 1; } else if (result.changed) { - console.log(ok(result.message)); + // message already carries the correct [OK]/[!] prefix from routing-strategy + console.log(result.message); } else { console.log(info(result.message)); }