Comments (7)
@brutuscat - One thing timetrap tries to do is interface well with other unix tools, so it may be you can get your desired behavior just by chaining timetrap with grep, or defining some bash aliases or functions that do the filtering on timetrap's output.
Something like:
t d | grep client1
There's also the custom formatter extension system which could do the trick. A formatter could look at a command line arg (e.g. Timetrap::CLI.args['-M']
) and filter it's output based on this value. I'll think some more about whether this does belong in timetrap's core. If you could provide some more details about the use cases you envision that would help.
Thanks,
Sam
from timetrap.
I understand what you say. It maybe because of my use-case, which is like this:
- I start a project sheet like this:
cd project_dir
basename `pwd`|xargs t sheet
- Then every time I'm going to work on some task I add a note like this:
t in "Speed up customer account index"
t out
t resume
t in "Add Reports"
t out
- Because through the week I work on more than one project I constantly switch projects. So at the end of the week I have to check what I did for whom.
One issue I have with grep is that if there is more than one note for that day, it may "forget" the date (but not the time.). Also I guess that the sum of the time for those particular "grepped" notes can be calculated with awk
but no idea how :S
Example missing dates:
> t d
Sun Apr 22, 2012 12:00:31 - 12:00:35 0:00:04 Client Summary
12:05:51 - 17:21:19 5:15:28 Reports Medium
5:15:32
Mon Apr 23, 2012 10:53:13 - 18:50:03 7:56:50 Reports Medium
20:41:06 - 21:19:24 0:38:18 Reports Medium
> t d|grep "Reports Medium"
Missing date...
12:05:51 - 17:21:19 5:15:28 Reports Medium
Mon Apr 23, 2012 10:53:13 - 18:50:03 7:56:50 Reports Medium
20:41:06 - 21:19:24 0:38:18 Reports Medium
from timetrap.
Take a look at the csv formatter. It should be more grepable for this case.
t d -f csv
You can even make it (or another) the default formatter with t configure
.
It's also pretty easy to write your own custom formatter, and let timetrap find it (by putting it in ~/.timetrap/formatters). There's some examples at https://github.com/samg/timetrap_formatters.
Let me know if that seems like a good solution for you.
from timetrap.
You should also be able to use the datesheet formatter for this. I have a bash and awk script that adds the time for specific search terms with the datesheet formatter.
from timetrap.
Slightly off topic and also trivial, but may be interesting for people who end up in this thread: I just realized that if you want to have 't week' rolling over the last 7 days (rather than leaving you with a blank sheet on Monday mornings), you can do this:
t display all --start 2013-08-25
I was going to place a feature request, but it's already there. Cool! (-:
thx~
from timetrap.
@mf59816 t display all --start '7 days ago'
should also work. :squirrel:
from timetrap.
probably already implemented with the -g
option, closing.
from timetrap.
Related Issues (20)
- Timetrap fails with recent sqlite3 HOT 2
- Deprecation notice (rb_check_safe_obj will be removed) HOT 10
- Help running this project HOT 1
- Add Project Maintainers HOT 9
- what is qs in the help output "-s, --start <date:qs>" HOT 2
- feature request: disallow comments that start with -[^ ] by default HOT 1
- feature request: undo the most recent out command. HOT 2
- Merging two timesheets HOT 4
- Autocomplete script assumes ~./timetrap.db existence HOT 2
- Invalid byte sequence in UTF 8 HOT 3
- Current specs are failing
- round-parameter not affecting json-formatted output HOT 1
- List previous months HOT 3
- [FEATURE] Add PR template HOT 2
- [Suggestion] Splitting up specs? HOT 2
- [Suggestion] Linting / Rubocop HOT 1
- Feature request: `partition` command HOT 1
- timetrap broken after latest mac update HOT 2
- t edit --append without editor HOT 2
- Installation Issue HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timetrap.