Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253import { branchConsumesNextValue, } from './branch-create-branch-options.ts';import { checkoutConsumesNextValue, } from './branch-create-checkout-options.ts';import { switchConsumesNextValue, } from './branch-create-switch-options.ts';import type { BranchCreationSubcommand, } from './branch-create-types.ts';
//region Subcommand dispatch helpers
/** Options for testing whether an argv token consumes the following token. */type ConsumesNextValueOptions = { /** Guarded subcommand whose option vocabulary applies. */ readonly subcommand: BranchCreationSubcommand; /** Argv token to inspect. */ readonly arg: string;};
/** Reports whether option consumes the next argv token as a value, dispatching to {@link branchConsumesNextValue}, {@link checkoutConsumesNextValue}, or {@link switchConsumesNextValue} by subcommand. @param subcommand - Guarded subcommand whose option vocabulary applies. @param arg - Argv token to inspect. @returns `true` when next token is a value, not another wrapper flag. @example ```ts consumesNextValue({ subcommand: 'switch', arg: '--create' }); // => true ``` */export function consumesNextValue({ subcommand, arg,}: ConsumesNextValueOptions,): boolean { if (subcommand === 'branch') return branchConsumesNextValue(arg,);
if (subcommand === 'checkout') return checkoutConsumesNextValue(arg,);
return switchConsumesNextValue(arg,);}
//endregion Subcommand dispatch helpers