Module

cli.helpers.validation

Validation helpers for CLI commands.

Functions

validate_mutually_exclusive
Decorator to validate mutually exclusive flags.
0 Callable[[F], F]
def validate_mutually_exclusive(*flag_pairs: tuple[str, str]) -> Callable[[F], F]

Decorator to validate mutually exclusive flags.

Returns

Callable[[F], F]

validate_flag_conflicts
Decorator to validate flag conflicts (one flag conflicts with multiple others).
2 Callable[[F], F]
def validate_flag_conflicts(conflicts: dict[str, list[str]], error_message: str | None = None) -> Callable[[F], F]

Decorator to validate flag conflicts (one flag conflicts with multiple others).

Parameters 2

Name Type Default Description
conflicts dict[str, list[str]]

Dict mapping flag name to list of conflicting flag names

error_message str | None None

Custom error message template (default: "{flag} cannot be used with {others}")

Returns

Callable[[F], F]