diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-11-04 12:51:30 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-11-04 12:51:30 -0500 |
commit | ce38f1a98210191755945a0e018ff871f422d0d0 (patch) | |
tree | 60e1353762752d6fe33586922762ad19fabb517b /src/gitget | |
parent | b195c3f87ab2910f76bec71fec659752aa7f6c5a (diff) |
gitget: fix option parsing
Diffstat (limited to 'src/gitget')
-rwxr-xr-x | src/gitget/gitget | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gitget/gitget b/src/gitget/gitget index 256b4e4..194ec05 100755 --- a/src/gitget/gitget +++ b/src/gitget/gitget @@ -191,6 +191,7 @@ main() { *) usage >&2; return 1;; esac done + shift $(($OPTIND - 1)) [[ $# == 3 ]] || { usage >&2; return 1; } local mode=$1 local url=${2#git+} @@ -198,6 +199,9 @@ main() { local urlmain=${url%%#*} local urlfrag=${url#*#} + if [[ "$urlfrag" == "$urlmain" ]]; then + urlfrag='' + fi local ref=${urlfrag#*=} if [[ -z $ref ]]; then |