pub fn select_command_target(
deployment_id: &str,
targets: &[CommandTarget],
requested: Option<&str>,
) -> Result<CommandTarget>Expand description
Target-selection rules shared by both the in-memory and SQLite registries route through.
requested = Some(id): the id must be well-formed (no:) and name an existing command-capable target, elseCOMMAND_TARGET_NOT_FOUND. An empty id never falls back to shorthand.requested = None(single-target shorthand): exactly one target must exist, elseCOMMAND_TARGET_AMBIGUOUS(more than one) orNO_COMMAND_TARGETS(none).
The resolved target’s own id is also validated, so a target registered with
a :-bearing id can never resolve into the key grammar.