style(pi): wrap mode arg lookup

This commit is contained in:
Peter Steinberger 2025-12-11 18:53:32 +00:00
parent 3abe474df6
commit 76e441c2c2

View File

@ -188,7 +188,8 @@ export const piSpec: AgentSpec = {
const argv = [...ctx.argv]; const argv = [...ctx.argv];
let bodyPos = ctx.bodyIndex; let bodyPos = ctx.bodyIndex;
const modeIdx = argv.indexOf("--mode"); const modeIdx = argv.indexOf("--mode");
const modeVal = modeIdx >= 0 ? argv[modeIdx + 1]?.toString().toLowerCase() : undefined; const modeVal =
modeIdx >= 0 ? argv[modeIdx + 1]?.toString().toLowerCase() : undefined;
const isRpcMode = modeVal === "rpc"; const isRpcMode = modeVal === "rpc";
// Non-interactive print + JSON // Non-interactive print + JSON
if (!isRpcMode && !argv.includes("-p") && !argv.includes("--print")) { if (!isRpcMode && !argv.includes("-p") && !argv.includes("--print")) {