Interaction#
- class cli_interview_kit.Interaction[source]#
Bases:
FrozenModelWhether a run may prompt, and whether it has blanket consent.
- Attributes:
- can_promptbool
Stdin is a terminal and
--yeswas not given.- consentbool
--yeswas given: every declared consent is granted.- declaredfrozenset[str]
The keys of the consents the running command declares; only these can be asked for.
Methods
resolve(yes[, declared])Return the interaction for a run, from
--yesand the terminal.- classmethod resolve(yes: bool, declared: frozenset[str] = frozenset({})) Interaction[source]#
Return the interaction for a run, from
--yesand the terminal.- Parameters:
- yesbool
Whether
--yeswas given.- declaredfrozenset[str]
The keys of the consents the running command declares.
- Returns:
- Interaction
The interaction every question and consent of the run follows.