NAME

Taskwarrior::Kusarigama::Core - Set of core functions interacting with Taskwarrior

VERSION

version 0.10.0

DESCRIPTION

Role consumed by Taskwarrior::Kusarigama::Hook.

METHODS

The role provides the following methods:

api

version

args

command

rc

data

pre_command_args

Returns the arguments that preceding the command as a string.

# assuming `task this and that foo` was run, and the command is 'foo'

$tw->pre_command_args; # => 'this and that'

Note that because the way the hooks get the arguments, there is no way to distinguish between

task 'this and that' foo

and

task this and that foo

post_command_args

Returns the arguments that follow the command as a string.

# assuming `task this and that foo sumfin` was run, and the command is 'foo'

$tw->post_command_args; # => 'sumfin'

data_dir

run_task

Returns a Taskwarrior::Kusarigama::Wrapper object.

plugins

Returns an arrayref of instances of the plugins defined under Taskwarrior's kusarigama.plugins configuration key.

export_tasks

my @tasks = $tw->export_tasks( @query );

Equivalent to

$ task export ...query...

Returns the list of the tasks.

new_task

my $task = $tw->new_task( \%task );
$task->save;

Creates a new task, but doesn't commit it yet (use save for that).

import_task

$tw->import_task( \%task  )

Equivalent to

$ task import <json representation of %task>

calc

$result = $tw->calc( qw/ today + 3d / );

Equivalent to

$ task calc today + 3d

AUTHOR

Yanick Champoux <yanick@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018, 2017 by Yanick Champoux.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.