#!/usr/bin/perl

use Text::Todo::Simple;

use warnings;
use strict;

=head1 NAME

t - Help people finish those damn tasks

=head1 VERSION

version 0.15

=head1 SYNOPSIS

 t [OPTIONS] [ACTION] [ARGS]

 Actions:
   add, a       TEXT
   do           ID
   remove, rm   ID
   list, ls     [STRING]
   move, mv     ID NEW
   edit, ed     ID TEXT/REGEX

 Options:
   --todo, -t   FILE
   --done, -d   FILE

=cut

Text::Todo::Simple -> run;

=head1 ACTION

=over 4

=item B<add>, B<a> TEXT

add a task to the list

=item B<do> ID

mark a task as done, and move it to the done file

=item B<remove>, B<rm> ID

remove a task from the list

=item B<list>, B<ls> [STRING]

list tasks containing STRING (can be empty)

=item B<move>, B<mv> ID NEW

move a task from ID to NEW

=item B<edit>, B<ed> ID TEXT/REGEX

replace the task ID with TEXT/REGEX. if TEXT begins with 's/' it will be
treated as a regex (see L<EXAMPLES>).

=back

=head1 ACTION

=over 4

=item B<--todo>, B<-t> FILE

set todo file (takes precedence on configuration)

=item B<--done>, B<-d> FILE

set todo file (takes precedence on configuration)

=back

=head1 CONFIGURATION

The following environment variables will affect t.pl behaviour:

=over

=item B<TODO_FILE>

Specifies the path of the todo file. Default ~/.todo

=item B<DONE_FILE>

Specifies the path of the done file. Default ~/.done

=item B<TODO_DEFAULT>

Set the default action, this will be used when no action is specified.
Default 'help'

=back

=head1 EXAMPLES

Add some tasks

    $ t add Do something boring
    Added task 1
    $ t add Do something else
    Added task 2

List tasks

    $ t ls
    1 Do something boring
    2 Do something else

Edit a task

    $ t ed 1 Do something funny
    Replaced task 1

or

    $ t ed 1 s/boring/funny/
    Replaced task 1

Mark a task as done

    $ t do 1
    Done task 1

Delete a task

    $ t rm 2
    Removed task 2

Count tasks

    $ t ls | wc -l
    0

=head1 AUTHOR

Alessandro Ghedini <alexbio@cpan.org>

=head1 SEE ALSO

L<Text::Todo::Simple>

=head1 LICENSE AND COPYRIGHT

Copyright 2010 Alessandro Ghedini.

This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

=cut