X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;ds=sidebyside;f=.bin%2Fvcs-url;fp=.bin%2Fvcs-url;h=6612a33c34a89cd8bf93319bf51648fbf9ab6d66;hb=a8d764366e7a95b7adb2b672ba1cf3123ecafb31;hp=99c00d9a19ce622b1cf1015c236529c60ec626ec;hpb=81c715a9b815e13d626a94b66f94d099e951fd3c;p=home.git diff --git a/.bin/vcs-url b/.bin/vcs-url index 99c00d9..6612a33 100755 --- a/.bin/vcs-url +++ b/.bin/vcs-url @@ -154,7 +154,7 @@ git_url() { ;; esac - git log -n3 ${1:-HEAD} | sed "s,^commit ,${url}," + git log -n${num} ${1:-HEAD} | sed "s,^commit ,${url}," } svn_url() { @@ -193,6 +193,8 @@ usage() { 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 @@ -202,9 +204,11 @@ usage() { } 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";; @@ -212,10 +216,11 @@ main() { -h) usage;; --) shift; break;; -*) usage;; - *) break;; + *) args+=( "$1" );; esac shift done + set -- "${args}" if [[ ${vcs} == "auto" ]] ; then if [[ -d CVS ]] ; then