;;
esac
- git log -n3 ${1:-HEAD} | sed "s,^commit ,${url},"
+ git log -n${num} ${1:-HEAD} | sed "s,^commit ,${url},"
}
svn_url() {
Usage: $0 [options] [args]
Options:
+ -# Number of commits to show (default: 3)
+ -n# Number of commits to show
-c CVS URL
-g GIT URL (default)
-s SVN URL
}
main() {
- local vcs="auto"
+ local vcs="auto" num="3" args=()
while [[ $# -gt 0 ]] ; do
case $1 in
+ -n[0-9]*) num="${1:2}";;
+ -[0-9]*) num="${1:1}";;
-c) vcs="cvs";;
-s) vcs="svn";;
-g) vcs="git";;
-h) usage;;
--) shift; break;;
-*) usage;;
- *) break;;
+ *) args+=( "$1" );;
esac
shift
done
+ set -- "${args}"
if [[ ${vcs} == "auto" ]] ; then
if [[ -d CVS ]] ; then