mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-01 04:11:03 +00:00
22 lines
512 B
TypeScript
22 lines
512 B
TypeScript
import { consumeRootOptionToken } from "../infra/cli-root-options.js";
|
|
|
|
export function forwardConsumedCliRootOption(
|
|
args: readonly string[],
|
|
index: number,
|
|
out: string[],
|
|
): number {
|
|
const consumedRootOption = consumeRootOptionToken(args, index);
|
|
if (consumedRootOption <= 0) {
|
|
return 0;
|
|
}
|
|
|
|
for (let offset = 0; offset < consumedRootOption; offset += 1) {
|
|
const token = args[index + offset];
|
|
if (token !== undefined) {
|
|
out.push(token);
|
|
}
|
|
}
|
|
|
|
return consumedRootOption;
|
|
}
|