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

NAME

App::ListOrgTodos - List all todo items in all Org files

VERSION

This document describes version 0.30 of App::ListOrgTodos (from Perl distribution App-OrgUtils), released on 2015-04-03.

SYNOPSIS

 # See list-org-todos script

DESCRIPTION

FUNCTIONS

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

List all todo items in all Org files.

Arguments ('*' denotes required arguments):

  • cache_dir => str

    Cache Org parse result.

    Since Org::Parser can spend some time to parse largish Org files, this is an option to store the parse result. Caching is turned on if this argument is set.

  • detail => bool (default: 0)

    Show details instead of just titles.

  • done => bool (default: 0)

    Only show todo items that are done.

  • due_in => int

    Only show todo items that are (nearing|passed) due.

    If value is not set, then will use todo item's warning period (or, if todo item does not have due date or warning period in its due date, will use the default 14 days).

    If value is set to something smaller than the warning period, the todo item will still be considered nearing due when the warning period is passed. For example, if today is 2011-06-30 and due_in is set to 7, then todo item with due date <2011-07-10 > won't pass the filter (it's still 10 days in the future, larger than 7) but <2011-07-10 Sun +1y -14d> will (warning period 14 days is already passed by that time).

  • files* => array[str]

  • from_level => int (default: 1)

    Only show 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[str]

    Only show headlines that have the specified tags.

  • lacks_tags => array[str]

    Only show headlines that don't have the specified tags.

  • maximum_priority => str

    Only show todo items that have at most this priority.

    Note that the default priority list is [A, B, C] (A being the highest) and it can be customized using the #+PRIORITIES setting.

  • minimum_priority => str

    Only show todo items that have at least this priority.

    Note that the default priority list is [A, B, C] (A being the highest) and it can be customized using the #+PRIORITIES setting.

  • priority => str

    Only show todo items that have this priority.

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

    Specify sorting.

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

    If code, sorting code will get [REC, DUE_DATE, 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), DUE_DATE is the DateTime object (if any), and HL is the Org::Headline object.

  • state => str

    Only show 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

    Only show headlines having this level as the maximum.

  • today => obj

    Assume today's date.

    You can provide Unix timestamp or DateTime object. If you provide a DateTime object, remember to set the correct time zone.

  • with_unknown_priority => bool

    Also show items with no/unknown priority.

    Relevant only when used with minimum_priority and/or maximum_priority.

    If this option is turned on, todo items that does not have any priority or have unknown priorities will still be included. Otherwise they will not be included.

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.

Return value: (any)

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/App-OrgUtils.

SOURCE

Source repository is at https://github.com/perlancar/perl-App-OrgUtils.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-OrgUtils

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by perlancar@cpan.org.

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