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

Improve CLI ergonomics #9

Closed oyarsa closed 2 years ago

oyarsa commented 2 years ago

The current output of bartib help start makes it seem like the project and the description are optional, but they aren't. If you try to run bartib start -d "Description", bartib replies with a panic. I had to go to the source code to understand what was happening.

❯ bartib start -d "Description"                                    
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/italo/.cargo/registry/src/github.com-1ecc6299db9ec823/bartib-1.0.0/src/main.rs:207:58          
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace  

You can fix this by marking the arguments as required on clap, or at least print a nice message explaining the problem.

nikolassv commented 2 years ago

Thank you, this has been fixed with PR #7 and will be part of the next release.