NAME

App::TimelogTxt - Commandline tracking of time for tasks and projects.

VERSION

This document describes App::TimelogTxt version 0.22

SYNOPSIS

use App::TimelogTxt;
App::TimelogTxt::run();

DESCRIPTION

This module encapsulates all of the functionality of the timelog application. This module delegates much of the heavy lifting to other modules. It does handle the UI work and the configuration file.

INTERFACE

At the moment, the only real interface to this file is the run command.

In the methods below, the $app parameter is an object of the class Timelog::CmdDispatch. This is a subclass of App::CmdDispatch that adds support needed for some of our configuration.

run()

This is the main routine of the module. It creates the command parser object, parses the command line and dispatches the work to the correct function.

init_timelog( $app, $dir )

Implementation of the 'init' command.

This routine creates the log directory if the directory doesn't exist. The optional $dir argument is the path to this directory. If $dir is not provided, use the default ~/timelog directory. If the configuration file doesn't exist, it creates that as well using the currently known values.

log_event( $app, @event );

Add the specified event to the end of timelog.txt

edit_logfile( $app )

Implementation of the 'edit' command.

Open the timelog.txt file in the configured editor.

list_events( $app, $day )

Implementation of the 'ls' command.

Display the events for the supplied $day. If no $day is supplied, use today.

list_projects( $app )

Implementation of the 'lsproj' command.

Extract all +project entries from the events in timelog.txt and display a sorted list, one per line.

daily_report( $app, $day, $end_day )

Implementation of the 'report' command.

Display a report of all events for the given days on STDOUT. If $end_day is not supplied, only display the report for $day. If $day is not supplied, default to today.

daily_summary( $app, $day, $end_day )

Implementation of the 'summary' command.

Display a report of all project times for the given days on STDOUT. If $end_day is not supplied, only display the report for $day. If $day is not supplied, default to today.

report_hours( $app, $day, $end_day )

Implementation of the 'hours' command.

Display a report of the hours the given days on STDOUT. If $end_day is not supplied, only display the report for $day. If $day is not supplied, default to today.

extract_day_tasks( $app, $day, $end_day )

Read the timelog.txt file and create an array of App::TimelogTxt::Day objects that contain the information for the days from $day to $end_day.

start_event( $app, @event )

Implementation of the 'start' command.

Add an event to the timelog.txt file.

push_event( $app, @event )

Implementation of the 'push' command.

Copy the current item from the timelog file to the stack and add the supplied event to the timelog file.

pop_event( $app )

Implementation of the 'pop' command.

Remove the most recent event from the stack and add it as a new event to the timelog file.

drop_event( $app, $arg )

Implementation of the 'drop' command.

Remove one or more items from the stack. If $arg is not supplied, remove one item. If $arg is a positive number, remove that many items from the stack. If $arg is 'all', clear the stack file.

list_stack( $app )

Implementation of the 'lstk' command.

Print the current stack on STDOUT.

current_event( $app )

Implementation of the 'curr' command.

Print the most recennt timelog event on STDOUT along with the duration since the start of the event. If not in an event, report that.

CONFIGURATION AND ENVIRONMENT

App::TimelogTxt requires no environment variables, but may use VISUAL or EDITOR if an editor is not configured in ~/.timelogrc.

App::TimelogTxt uses the file ~/.timelogrc for configuration information.

The configuration file is expected to contain data in two major parts:

General Configuration

The first section defined general configuration information in a key=value format. The recognized keys are:

editor

The editor to use when opening the timelog file with the edit command. If not specified, it will use the value of either the VISUAL or EDITOR environment variables. If non are found, it will default to vim.

dir

The directory in which to find the timelog data files. Defaults to the timelog directory in the user's home directory.

defcmd

The default command to by used if none is supplied to timelog. By default, this is the 'stop' command.

Command Aliases

The config file may also contain an '[alias]' section that defines command aliases. Each alias is defined as a shortname=expanded string

For example, if you regularly need to make entries for reading email and triaging bug reports you might want the following in your configuration.

[alias]
  email = start +Misc @Email
  triage = start +BugTracker @Triage

DEPENDENCIES

App::CmdDispatch, Getopt::Long, File::Path, autodie.

INCOMPATIBILITIES

None reported.

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to bug-app-timelogtxt@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR

G. Wade Johnson <gwadej@cpan.org>

LICENCE AND COPYRIGHT

Copyright (c) 2013, G. Wade Johnson <gwadej@cpan.org>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.