samg / timetrap

Simple command line timetracker
http://rubygems.org/gems/timetrap
Other
1.48k stars 116 forks source link

"t last week" would be useful #107

Closed kevinior closed 4 years ago

kevinior commented 9 years ago

I often need to check times from the previous week and "t disp --start='last monday' --end='last friday'" is more typing than I'd like.

How about either "last" as a prefix for the "week" and "month" shortcuts or a "--last" option for them?

tekknolagi commented 9 years ago

So something like t disp --start='last week'? Or do you mean t disp 'last week'?

tekknolagi commented 9 years ago

Incidentally, you can make a shell alias until it's added (if it is):

alias tlastweek="t disp --start='last monday' --end='last friday'"

kevinior commented 9 years ago

t disp last week would be especially handy for me but I suppose that might make handling the command-line arguments ugly. t week --last would work too.

I'd guess that people often want to see the previous/week month (especially when entering hours into another system) so the less typing involved the better.

tekknolagi commented 9 years ago

I tried hacking in a sort of "modifier" thing for week, month, etc but it's not super pretty. I'll post the diff somewhere.

tekknolagi commented 9 years ago

https://gist.github.com/tekknolagi/1c8deb93148a624bfc2e

kevinior commented 9 years ago

That looks great, although I'm not qualified to judge prettiness of Ruby code :smile:

categulario commented 4 years ago

t week is available in recent versions, closing for now