Skip to main content

command_region

Function command_region 

Source
pub fn command_region(stripped: &StrippedInvocation) -> &[OsString]
Expand description

What: The tokens after the command word of an invocation that names a command. &[OsString] borrows those tokens. Why: The refusal frontier and the push gate both read the command’s own options; taking the region from one function keeps the two from reading different tokens.

In TS you’d write (pseudocode):

function commandRegion(stripped: StrippedInvocation): string[] { return stripped.args.slice(stripped.layout.prefixLen + 1); }