link

gest iteration link: link an iteration to another entity.

struct Command

source

pub struct Command

Link an iteration to another entity.

Field Type Description
id String The iteration ID or prefix.
args Vec<String> Positional arguments: either <target> (new form) or <rel> <target> (deprecated).
artifact bool Target is an artifact instead of another iteration.
rel Option<RelationshipType> The relationship type (e.g. blocks, blocked-by, relates-to).
output json::Flags The output mode: normal, --json, --quiet or --raw.

Implements FromArgMatches, Args, Debug.

Command::call

source

pub async fn call(&self, context: &AppContext) -> Result<(), Error>

Create a relationship row (and reciprocal for iteration-to-iteration links) within a recorded transaction.

Parameter Type Description
context &AppContext the application context: settings, store and current project
returns Result<(), Error> Ok(()) when the command succeeds, or the error that stopped it.

Command::resolve_rel_and_target

source

fn resolve_rel_and_target(&self) -> Result<(RelationshipType, String), Error>

Resolve the effective relationship type and target string from positional args and flags.

Supports the new <id> <target> [--rel <type>] form and the legacy <id> <rel> <target> form. The legacy form emits a deprecation warning to stderr, and combining a positional rel with --rel is rejected as a conflict.

Parameter Type Description
returns Result<(RelationshipType, String), Error> The relationship type, relates-to when none is given, and the target; or Error::Argument for a bad or doubled rel, or the wrong number of arguments.