From 4f978ec26b6b374f9bc82c5f11cc062b1d3929c2 Mon Sep 17 00:00:00 2001 From: structix Date: Sun, 6 Jan 2019 18:41:06 +0100 Subject: [PATCH] Added -s flag --- gitistics.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gitistics.sh b/gitistics.sh index 558198b..7a16025 100755 --- a/gitistics.sh +++ b/gitistics.sh @@ -8,7 +8,7 @@ REPOUSER=$(whoami) #REPOUSER="\(structix\|Janek\)" # Specify the start date, where the statistics should be gathered -STARTDATE="01 Jan 2018" +STARTDATE="1 year ago" # Verbose flag VERBOSE=false @@ -102,7 +102,7 @@ function main() { echo "-------------------------" - echo "Total commits since $STARTDATE: $commitcounter" + echo "Total commits starting from $STARTDATE: $commitcounter" echo "Total files changed: $totalfiles" echo "Total insertions: $totalinsertions" echo "Total deletions: $totaldeletions" @@ -119,14 +119,16 @@ print_usage() { echo "-h show this help page" echo "-u set a repository username or a regex pattern (brackets etc. must be escaped with \ )" echo "-r set a directory with your repositories" + echo "-s set the date (e.g. 01 JAN 2018) where the stats should start" echo "-v show verbose output" } # process the arguments -while getopts 'u:r:vh' flag; do +while getopts 'u:r:s:vh' flag; do case "${flag}" in u) REPOUSER="${OPTARG}" ;; r) REPODIR="${OPTARG}" ;; + s) STARTDATE="${OPTARG}" ;; v) VERBOSE=true ;; h) print_usage; exit 0 ;; *) print_usage