kamranahmedse / git-standup

Recall what you did on the last working day. Psst! or be nosy and find what someone else in your team did ;-)
MIT License
7.62k stars 304 forks source link

Add option to check more than one day #15

Closed fabienduhamel closed 8 years ago

fabienduhamel commented 8 years ago

It should be nice to run:

$ git-standup -d 3

and see what I have done in the last 3 days.

neeasade commented 8 years ago

As there are currently options for name and week start/end(which only works if you include both) -- maybe move this to use getopts ?

git standup -n "name" -w "SUN-SAT" -d 4 ?

but still be compatible with a one name call if one arg.

kamranahmedse commented 8 years ago

Nope, it would work even if you do not provide the week days and only the name. But to change weekdays which is the last parameter you will have to provide the name as well.

Anyways, it needs to be changed, I had it in mind to change that just holding off for not having much time to work on that.

neeasade commented 8 years ago

I guess, better would be to use long options i.e.: git standup --name="name" -week="SUN-SAT" --days=4

rockin - perhaps instead of days, maybe just allow an option to set the SINCE arg you're passing to the git log command?

kamranahmedse commented 8 years ago

Maybe, but I guess days option should itself be there as well.

fabienduhamel commented 8 years ago

Getops should work fine as @neeasade said. It handles long and short options in any order.

git-standup -n "name" -w "SUN-SAT" -d 4
git standup --name="name" --week="SUN-SAT" --days=4
git standup -n "name" --week="SUN-SAT" -d 4
git standup -d 4

should run perfectly. I tried not to broke the code yesterday but it seems that this is the best option. Next try soon.

neeasade commented 8 years ago

@fabienduhamel getopts bash builtin does not handle long args. getopt (a shell arg tool present in most linux systems, not OSX/BSD systems) does handle long args (ref link). The most portable option appears to be something like this.

fabienduhamel commented 8 years ago

You're right. Thank you for correcting me.

kamranahmedse commented 8 years ago

Added the support for that. Now you can do

$ git standup -d 5

And it will show you what you have done since the last 5 days. Also, other options have been updated, now there are -a, -w and -d flags for author, week and days respectively.

fabienduhamel commented 8 years ago

Thank you :+1:

nicosomb commented 8 years ago

Hello @kamranahmedse!

Can you tag a new release with this nice feature (thanks @fabienduhamel for the idea ;-) ) please? Then I will publish this new version on homebrew.

kamranahmedse commented 8 years ago

Hey @nicosomb I forgot to make a release for that. Just created it https://github.com/kamranahmedse/git-standup/releases/tag/2.0.0. Thanks