NAME
App::karr::Role::DependencyArgs - Turn the dependency ids a command was given into validated numbers
VERSION
version 0.500
DESCRIPTION
The set-time half of karr's dependency handling: what --depends-on, --add-depends-on and --remove-depends-on mean between the command line and $task->depends_on. Composed by App::karr::Cmd::Create and App::karr::Cmd::Edit, the only two commands that take those options.
Its sibling is App::karr::Role::DependencyCheck, which reads the field back when a card is taken up. kanban-md does both too (ValidateDependencyIDs, internal/task/validate.go:155): set-time catches a typo while the author still remembers what they meant, move-time catches state that changed afterwards, which set-time can never see.
Why it is not one role with the check
The two halves have different contracts. This one reports through "usage_error" in App::karr::Role::ExitCodes -- it refuses the invocation and nothing is written -- while the checking half prints a warning, proceeds, and therefore needs the command's output options (--json, --quiet) to decide which channel the warning goes out of. Carrying both in one role meant the requires line could only name what every consumer had, so json could not be required at all: create composed the role for these two helpers alone and has no --json (ticket #137). Split, each half declares its own collaborators in full, and create no longer inherits two methods it must never call.
SEE ALSO
karr, App::karr, App::karr::Role::DependencyCheck, App::karr::Cmd::Create, App::karr::Cmd::Edit
parse_dependency_ids
my $ids = $self->parse_dependency_ids( '--depends-on', $self->depends_on );
Splits a comma-separated dependency option value into an arrayref of numeric ids, in order, duplicates collapsed. A value that is not a plain number is a usage error naming the flag and the value, raised before any task is touched -- it condemns the invocation, never one id of a batch. The ids are returned as numbers so they round-trip numerically through the frontmatter and --json (kanban-md models the field as an IntSlice).
assert_dependencies_exist
$self->assert_dependencies_exist($ids);
Usage error unless every id names a task on this board, archived included -- the same "find_task" in App::karr::Role::BoardAccess lookup "check_dependencies" in App::karr::Role::DependencyCheck resolves ids with, so set-time and move-time can never disagree about what exists. Called with ids that are about to be added; removing an id the board no longer has must stay legal, because that is how a dependency on a deleted task is cleaned up.
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/karr/issues.
IRC
Join #langertha on irc.perl.org or message Getty directly.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <getty@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.