Index: cg-log =================================================================== --- 456fffab323ed972b8e47fa0fb83c3b5cd9243d7/cg-log (mode:100755) +++ uncommitted/cg-log (mode:100755) @@ -27,29 +27,34 @@ # at least somewhere it does. Bash is broken. trap exit SIGPIPE -if [ "$1" = "-c" ]; then - shift - # See terminfo(5), "Color Handling" - colheader="$(tput setaf 2)" # Green - colauthor="$(tput setaf 6)" # Cyan - colcommitter="$(tput setaf 5)" # Magenta - colfiles="$(tput setaf 4)" # Blue - colsignoff="$(tput setaf 3)" # Yellow - coldefault="$(tput op)" # Restore default -else - colheader= - colauthor= - colcommitter= - colfiles= - colsignoff= - coldefault= -fi - +colheader= +colauthor= +colcommitter= +colfiles= +colsignoff= +coldefault= list_files= -if [ "$1" = "-f" ]; then - shift - list_files=1 -fi +while [ "$1" ]; do + case "$1" in + -c) + # See terminfo(5), "Color Handling" + colheader="$(tput setaf 2)" # Green + colauthor="$(tput setaf 6)" # Cyan + colcommitter="$(tput setaf 5)" # Magenta + colfiles="$(tput setaf 4)" # Blue + colsignoff="$(tput setaf 3)" # Yellow + coldefault="$(tput op)" # Restore default + shift + ;; + -f) + list_files=1 + shift + ;; + *) + break + ;; + esac +done list_commit_files() {