diff --git a/README.md b/README.md index 2b0714a..9ef37ef 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Available options: -h, --help Print this help and exit -n, --no-space Remove spaces between week columns -s, --style Sets style of the graph: square (default), block, or plus +--monday-first Set Monday to be the first day of the week ``` The output of the command displays a colored graph similar to the one that you can find in any GitHub profile webpage: diff --git a/git-activity b/git-activity old mode 100644 new mode 100755 index 1c63bdf..8ef2a0b --- a/git-activity +++ b/git-activity @@ -18,6 +18,7 @@ EOF } # Parse options +weekdays="$(seq 0 6)" space=" " style=square while [[ $# -gt 0 ]]; do @@ -27,6 +28,7 @@ while [[ $# -gt 0 ]]; do shift 2 ;; -n|--no-space) space="" ;; + --monday-first) weekdays="1 2 3 4 5 6 0" ;; -h|--help) usage exit 0 @@ -90,7 +92,7 @@ printf "\n" # Print activity last_day=$(( ($(date "+%s") - since) / (60*60*24) )) name_of_days=("" "Mon" "" "Wed" "" "Fri" "" "") -for day_n in $(seq 0 6); do +for day_n in $weekdays; do printf '\e[m%-4s' "${name_of_days[day_n]}" for week_n in $(seq 0 52); do key=$(( week_n * 7 + day_n ))