GithubHelp home page GithubHelp logo

Add display filter about timetrap HOT 7 CLOSED

samg avatar samg commented on September 27, 2024
Add display filter

from timetrap.

Comments (7)

samg avatar samg commented on September 27, 2024

@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.

brutuscat avatar brutuscat commented on September 27, 2024

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.

samg avatar samg commented on September 27, 2024

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.

jostber avatar jostber commented on September 27, 2024

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.

mf59816 avatar mf59816 commented on September 27, 2024

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.

samg avatar samg commented on September 27, 2024

@mf59816 t display all --start '7 days ago' should also work. :squirrel:

from timetrap.

categulario avatar categulario commented on September 27, 2024

probably already implemented with the -g option, closing.

from timetrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.