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
670 stars 35 forks source link

Add an option to only print current projects #13

Closed samoylovfp closed 2 years ago

samoylovfp commented 2 years ago

First of all thanks for the great tool!

I use oh-my-zsh with a bunch of plugins and I think this will be very nice to see the current running project without having to type bartib current. This helps with remembering that I need to switch projects.

samoylovfp commented 2 years ago

How I managed to set it up for my terminal image

nikolassv commented 2 years ago

Thank you for your pull request. I moved the new option to the subcommand projects. I thought it may be a better fit there.

The output for projects is a little different as it adds quotation marks and a newline. Would this work for you, too?

samoylovfp commented 2 years ago

I managed to make it working with some post-processing but this looks slightly worse

Function to generate the prompt value image

How it looks image

I'm OK with this if it makes more sense to you, you're the boss :smile:

nikolassv commented 2 years ago

You're right the trailing comma does not look good. You should be able to get rid of it with paste instead of tr. Try this:

bartib projects -c | tr -d '\"' | paste -sd ',' -
samoylovfp commented 2 years ago

Yes it now looks great! Thanks again for this project and your help!