The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::ListOrgTodos - List todo items in Org files

VERSION

version 0.13

SYNOPSIS

 # See list-org-todos script

DESCRIPTION

FUNCTIONS

None are exported, but they are exportable.

FUNCTIONS

list_org_todos(%args) -> [status, msg, result, meta]

List all todo items in all Org files.

Arguments ('*' denotes required arguments):

  • detail => bool (default: 0)

    Show details instead of just titles.

  • done => bool (default: 0)

    Filter todo items that are done.

  • due_in => int

    Filter todo items which is due in this number of days.

    Note that if the todo's due date has warning period and the warning period is active, then it will also pass this filter irregardless. Example, if today is 2011-06-30 and due_in is set to 7, then todo with due date won't pass the filter but will (warning period 14 days is already active by that time).

  • files* => array

  • from_level => int (default: 1)

    Filter headlines having this level as the minimum.

  • group_by_tags => bool (default: 0)

    Whether to group result by tags.

    If set to true, instead of returning a list, this function will return a hash of lists, keyed by tag: {tag1: [hl1, hl2, ...], tag2: [...]}. Note that some headlines might be listed more than once if it has several tags.

  • has_tags => array

    Filter headlines that have the specified tags.

  • lacks_tags => array

    Filter headlines that don't have the specified tags.

  • priority => str

    Filter todo items that have this priority.

  • sort => code|str (default: "due_date")

    Specify sorting.

    If string, must be one of 'duedate', '-duedate' (descending).

    If code, sorting code will get [REC, DUEDATE, HL] as the items to compare, where REC is the final record that will be returned as final result (can be a string or a hash, if 'detail' is enabled), DUEDATE is the DateTime object (if any), and HL is the Org::Headline object.

  • state => str

    Filter todo items that have this state.

  • time_zone => str

    Will be passed to parser's options.

    If not set, TZ environment variable will be picked as default.

  • to_level => int

    Filter headlines having this level as the maximum.

Return value:

Returns an enveloped result (an array). First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Steven Haryanto.

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