Files
orca/src/cli/remote-selection-flag-rejection.ts
T
OrcaWinandOrcaWin 9aa208a4ab [comment audit] Shorten remaining CLI root comments (#32273)
* chore: shorten process-host comments

* chore: audit CLI parsing and host-routing comments

* chore: remove stale host-selector restriction comment

* chore: shorten remaining CLI root comments

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-23 08:07:03 -07:00

22 lines
702 B
TypeScript

import { RuntimeClientError } from './runtime/types'
// Local-only command families reject explicit runtime selectors rather than silently ignoring them.
export const REMOTE_SELECTION_FLAGS = ['environment', 'pairing-code'] as const
/** suffix completes "--<flag> does not retarget …" with the command's actual scope. */
export function rejectRemoteSelectionFlags(
flags: ReadonlyMap<string, string | boolean>,
suffix: string,
data?: Record<string, unknown>
): void {
for (const flag of REMOTE_SELECTION_FLAGS) {
if (flags.has(flag)) {
throw new RuntimeClientError(
'invalid_argument',
`\`--${flag}\` does not retarget ${suffix}`,
data
)
}
}
}