Crates.io | work_tock |
lib.rs | work_tock |
version | 0.2.1 |
source | src |
created_at | 2019-01-22 10:17:04.289482 |
updated_at | 2021-07-05 17:29:16.237286 |
description | A Program to track your hours across various projects |
homepage | |
repository | https://github.com/storyfeet/work_tock |
max_upload_size | |
id | 109969 |
size | 47,705 |
A command line work tracking program.
See Documentation for basic file format
otherwise the --help command should be useful enough.
You can use this program to clockin
work_tock -i <JobName>
clockout
work_tock -o
Or print a record of recent clock entries with flags
work_tock --job_s dothing -p --since 03/04/2020
The program works with a single text file that is easy to edit if needed. The program will never overwrite your file, only read and append, so all data in that file will otherwise remain untouched.
To set the location of the core file, the default config for your program can be found in "$HOME/.config/work_tock/init.toml
[config]
# Set path the the current working file
# anything within "{}" is read as an environment variable
file="{HOME}/<path>/<to>/<file>"
#Optional require all job entries to be snake_case
snake=true
#camel=true #if you prefer camelCase
A standard file looks like this :
$home_jobs[car_wash,eat]
23/01/2019
car_wash,12:30-13:50
15:00,#car_wash is implied by previous Job
programming,16:00,#Clockout for car_wash is implied by new Job
eat,17:00
-18:00,#Clockout
24/01/2019
12:00,#Eating is implied as it was the last job
-13:00
programming,14:00
-16:00
$group_name[list,of,jobs,in,group]
Every Clockin will use the most recent Job,Date, and Tags for the clocking,
So given the example file work_tock
will produce:
{"car_wash": 02:20, "eat": 04:00, "programming": 01:00}
Total Time = 07:20
Using "-p" Will print all entries, but if you want to be morse spcific you can apply a filter and -p will print only entries that pass that filter.
NOTE: -t for today used to be -d which is now used to specify a date to work on
To get more relevent data you can use filters such as "-t" :Today, or "--day 3/1/2019", or by job
eg: work_tock -p --job car_wash
will return
23/01/2019
car_wash: 12:30-13:50 = 01:20 => 01:20
car_wash: 15:00-16:00 = 01:00 => 02:20
{"car_wash": 02:20}
Total Time = 02:20
or work_tock -p --group home_jobs
will produce:
Filtering by group home_jobs
23/01/2019
car_wash: 12:30-13:50 = 01:20 => 01:20
car_wash: 15:00-16:00 = 01:00 => 02:20
eat: 17:00-18:00 = 01:00 => 03:20
24/01/2019
eat: 12:00-13:00 = 01:00 => 04:20
{"car_wash": 02:20, "eat": 02:00}
Total Time = 04:20
Add the following to your bashrc
_work_tock_complete(){
local COMPLETES=$(work_tock complete)
COMPREPLY=( $(compgen -W "$COMPLETES" -- ${COMP_WORDS[COMP_CWORD]}) )
return 0
}
complete -F _work_tock_complete work_tock
Add one of the following to "$HOME/.config/ru_shell/init.rush"
#if first entry create a map object
let RU_COMPLETE={work_tock= r#"$[work_tock complete]"#}
#else add the map that already exists
push RU_COMPLETE={work_tock= r#"$[work_tock complete]"#}
For more information use work_tock --help
Tab completion enabled
to help with issues arising from forgetting to clockout yesterday, -y can be used to treat the current day as yesterday, eg: yesterday I clocked in at 12:00 and forgot to clockout at 17:00
work_tock -oy -a 17:00
means
work_tock out yesterday at 17:00
Bug fix -- Now handles empty files properly (Oops)
now takes -q option for clockin to previous Job
Added error handling for loggin in and out on different days.
switched order of logging in and printed statements to include the current logout on the printed statements.
Documented use of toml instead of lazyf
Separated library from application
Trying to get repository and docs showing on Cargo
Added Docs to readme
Added basic usage documentation