Skip to main content

selection_error

Function selection_error 

Source
pub fn selection_error(
    selected: &[PolicyId],
    policies: &PolicyConfig,
    trigger: Trigger,
) -> Option<ConfigError>
Expand description

What: The refusal for a direct command, when any selected policy has severity off, or is on but does not run for this command; None when nothing is selected or every selected policy runs. &[PolicyId] is the --policy selection, &PolicyConfig the severities in effect, and trigger is DirectCheck or DirectFix. Why: One message names every such policy, in selection order, so a repeated --policy is answered once and a run never silently drops a selected policy.

In TS you’d write (pseudocode):

function selectionError(selected: PolicyId[], policies: PolicyConfig, trigger: PolicyTrigger): ConfigError | undefined;