Skip to main content

Module policy

Module policy 

Source

Structs§

FlagPolicy
FlagTolerance
How the dispatcher treats tokens that look like flags but aren’t in the allowlist. unknown controls flag-shaped unknowns; numeric_dash opts into -NUMBER shorthand (e.g. head -20).

Enums§

PositionalShape
Predicate over the first positional token of a fallback grammar. Lets a TOML-declared fallback say “the first positional must look like a path” without the handler hardcoding the test.
UnknownTolerance
Whether unrecognized flag-shaped tokens are denied or silently accepted as positional arguments. The default (Strict) makes the allowlist authoritative — any unrecognized -X or --foo is denied.

Traits§

FlagSet

Functions§

check
check_flags
looks_like_path
Heuristic for “this token looks like a file path.” Used by the path PositionalShape. Conservative on purpose — a bare word like Tiltfile is a valid filename in cwd but the heuristic rejects it to avoid swallowing flag-less subcommands. Callers that want bare-name acceptance should match a sub block instead.