nikolassv / bartib

A simple timetracker for the command line. It saves a log of all tracked activities as a plaintext file and allows you to create flexible reports.
GNU General Public License v3.0
636 stars 34 forks source link

`report` command: Use `wildmatch` for matching projects in reports #43

Closed simonsan closed 5 months ago

simonsan commented 5 months ago

For projects, I use scope-inspired area::project-name syntax, for example an area in my life is maintainer/maintenance. One project is rustic. So for that I would use: maintenance::rustic.

bartib report

maintenance::github.............................. 1h 09m
    Updated dependencies of different projects... 1h 09m

maintenance::rustic..............................    16m
    Collected thoughts about a possible GUI impl.    16m

Total............................................ 1h 25m

But there are other projects in that area and in a report I would like to filter for one area with its projects. For example, report -p maintenance* or report -p maintenance::* doesn't work to show me a report for all projects within a certain area.

I'm aware, that adding another parameter to the report command and even an addition like area to the bartib activity file is too much of an ask. So my idea was to use wildcards for matching in a project, so people can implement their own scoping rules.

One library that might be useful for that, might be: https://github.com/becheran/wildmatch