| skipped 17 lines |
18 | 18 | | Available options are |
19 | 19 | | c,commit! open current commit |
20 | 20 | | i,issue! open issues page |
| 21 | + | s,suffix= append this suffix |
21 | 22 | | p,print! just print the url |
22 | 23 | | " |
23 | 24 | | |
| skipped 6 lines |
30 | 31 | | is_issue=0 |
31 | 32 | | protocol="https" |
32 | 33 | | print_only=0 |
| 34 | + | suffix_flag="" |
33 | 35 | | |
34 | 36 | | while test $# != 0; do |
35 | 37 | | case "$1" in |
36 | 38 | | --commit) is_commit=1;; |
37 | 39 | | --issue) is_issue=1;; |
| 40 | + | --suffix=*) suffix_flag="$1";; |
38 | 41 | | --print) print_only=1;; |
39 | 42 | | --) shift; break ;; |
40 | 43 | | esac |
41 | 44 | | shift |
42 | 45 | | done |
| 46 | + | |
| 47 | + | # parse suffix from suffix=value |
| 48 | + | IFS='=' read -ra suffix_flag <<< "$suffix_flag" |
| 49 | + | suffix=${suffix_flag[1]} |
43 | 50 | | |
44 | 51 | | # are we in a git repo? |
45 | 52 | | if ! git rev-parse --is-inside-work-tree &>/dev/null; then |
| skipped 190 lines |
236 | 243 | | elif [[ $remote_ref != "master" ]]; then |
237 | 244 | | # simplify URL for master |
238 | 245 | | openurl="$openurl$providerBranchRef" |
| 246 | + | fi |
| 247 | + | |
| 248 | + | if [ "$suffix" ]; then |
| 249 | + | openurl="$openurl/$suffix" |
239 | 250 | | fi |
240 | 251 | | |
241 | 252 | | # get current open browser command |
| skipped 25 lines |