blob: e3f6d543fb5bb0777483081fadaa7b66035ab5fa [file] [log] [blame]
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -05001#!/bin/sh
2#
3# This program resolves merge conflicts in git
4#
5# Copyright (c) 2006 Theodore Y. Ts'o
David Aguilar8827b3a2016-10-07 16:58:03 -07006# Copyright (c) 2009-2016 David Aguilar
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -05007#
8# This file is licensed under the GPL v2, or a later version
Josh Triplett2571ac62007-06-05 21:24:19 -07009# at the discretion of Junio C Hamano.
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050010#
11
Denton Liu063f2bd2018-10-24 12:25:31 -040012USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [-g|--gui|--no-gui] [-O<orderfile>] [file to merge] ...'
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050013SUBDIRECTORY_OK=Yes
Charles Bailey7bfb7c32014-10-11 01:39:37 -070014NONGIT_OK=Yes
Junio C Hamano8f321a32007-11-06 01:50:02 -080015OPTIONS_SPEC=
David Aguilar21d0ba72009-04-08 00:17:20 -070016TOOL_MODE=merge
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050017. git-sh-setup
David Aguilar21d0ba72009-04-08 00:17:20 -070018. git-mergetool--lib
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050019
20# Returns true if the mode reflects a symlink
Theodore Ts'o262c9812007-03-29 06:55:11 -040021is_symlink () {
Junio C Hamanof8750a02012-08-22 22:33:15 -070022 test "$1" = 120000
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050023}
24
Jonathon Mahff7f0892011-04-13 03:00:48 -070025is_submodule () {
Junio C Hamanof8750a02012-08-22 22:33:15 -070026 test "$1" = 160000
Jonathon Mahff7f0892011-04-13 03:00:48 -070027}
28
Theodore Ts'o262c9812007-03-29 06:55:11 -040029local_present () {
Junio C Hamanof8750a02012-08-22 22:33:15 -070030 test -n "$local_mode"
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050031}
32
Theodore Ts'o262c9812007-03-29 06:55:11 -040033remote_present () {
Junio C Hamanof8750a02012-08-22 22:33:15 -070034 test -n "$remote_mode"
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050035}
36
Theodore Ts'o262c9812007-03-29 06:55:11 -040037base_present () {
Junio C Hamanof8750a02012-08-22 22:33:15 -070038 test -n "$base_mode"
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050039}
40
David Aguilar8f0cb412014-10-11 10:04:45 -070041mergetool_tmpdir_init () {
42 if test "$(git config --bool mergetool.writeToTemp)" != true
43 then
44 MERGETOOL_TMPDIR=.
45 return 0
46 fi
47 if MERGETOOL_TMPDIR=$(mktemp -d -t "git-mergetool-XXXXXX" 2>/dev/null)
48 then
49 return 0
50 fi
51 die "error: mktemp is needed when 'mergetool.writeToTemp' is true"
52}
53
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050054cleanup_temp_files () {
Junio C Hamanof8750a02012-08-22 22:33:15 -070055 if test "$1" = --save-backup
56 then
57 rm -rf -- "$MERGED.orig"
58 test -e "$BACKUP" && mv -- "$BACKUP" "$MERGED.orig"
59 rm -f -- "$LOCAL" "$REMOTE" "$BASE"
60 else
61 rm -f -- "$LOCAL" "$REMOTE" "$BASE" "$BACKUP"
62 fi
David Aguilar8f0cb412014-10-11 10:04:45 -070063 if test "$MERGETOOL_TMPDIR" != "."
64 then
65 rmdir "$MERGETOOL_TMPDIR"
66 fi
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050067}
68
Theodore Ts'o262c9812007-03-29 06:55:11 -040069describe_file () {
Junio C Hamanof8750a02012-08-22 22:33:15 -070070 mode="$1"
71 branch="$2"
72 file="$3"
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050073
Junio C Hamanof8750a02012-08-22 22:33:15 -070074 printf " {%s}: " "$branch"
75 if test -z "$mode"
76 then
77 echo "deleted"
78 elif is_symlink "$mode"
79 then
80 echo "a symbolic link -> '$(cat "$file")'"
81 elif is_submodule "$mode"
82 then
83 echo "submodule commit $file"
84 elif base_present
85 then
86 echo "modified file"
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050087 else
Junio C Hamanof8750a02012-08-22 22:33:15 -070088 echo "created file"
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050089 fi
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050090}
91
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -050092resolve_symlink_merge () {
Junio C Hamanof8750a02012-08-22 22:33:15 -070093 while true
94 do
95 printf "Use (l)ocal or (r)emote, or (a)bort? "
96 read ans || return 1
97 case "$ans" in
98 [lL]*)
99 git checkout-index -f --stage=2 -- "$MERGED"
100 git add -- "$MERGED"
101 cleanup_temp_files --save-backup
102 return 0
103 ;;
104 [rR]*)
105 git checkout-index -f --stage=3 -- "$MERGED"
106 git add -- "$MERGED"
107 cleanup_temp_files --save-backup
108 return 0
109 ;;
110 [aA]*)
111 return 1
112 ;;
113 esac
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -0500114 done
115}
116
117resolve_deleted_merge () {
Junio C Hamanof8750a02012-08-22 22:33:15 -0700118 while true
119 do
120 if base_present
121 then
122 printf "Use (m)odified or (d)eleted file, or (a)bort? "
123 else
124 printf "Use (c)reated or (d)eleted file, or (a)bort? "
125 fi
126 read ans || return 1
127 case "$ans" in
128 [mMcC]*)
129 git add -- "$MERGED"
David Aguilara2986042016-03-09 23:13:59 -0800130 if test "$merge_keep_backup" = "true"
131 then
132 cleanup_temp_files --save-backup
133 else
134 cleanup_temp_files
135 fi
Junio C Hamanof8750a02012-08-22 22:33:15 -0700136 return 0
137 ;;
138 [dD]*)
139 git rm -- "$MERGED" > /dev/null
140 cleanup_temp_files
141 return 0
142 ;;
143 [aA]*)
David Aguilara2986042016-03-09 23:13:59 -0800144 if test "$merge_keep_temporaries" = "false"
145 then
146 cleanup_temp_files
147 fi
Junio C Hamanof8750a02012-08-22 22:33:15 -0700148 return 1
149 ;;
150 esac
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -0500151 done
152}
153
Jonathon Mahff7f0892011-04-13 03:00:48 -0700154resolve_submodule_merge () {
Junio C Hamanof8750a02012-08-22 22:33:15 -0700155 while true
156 do
157 printf "Use (l)ocal or (r)emote, or (a)bort? "
158 read ans || return 1
159 case "$ans" in
160 [lL]*)
161 if ! local_present
162 then
163 if test -n "$(git ls-tree HEAD -- "$MERGED")"
164 then
165 # Local isn't present, but it's a subdirectory
166 git ls-tree --full-name -r HEAD -- "$MERGED" |
167 git update-index --index-info || exit $?
168 else
169 test -e "$MERGED" && mv -- "$MERGED" "$BACKUP"
170 git update-index --force-remove "$MERGED"
171 cleanup_temp_files --save-backup
172 fi
173 elif is_submodule "$local_mode"
174 then
175 stage_submodule "$MERGED" "$local_sha1"
176 else
177 git checkout-index -f --stage=2 -- "$MERGED"
178 git add -- "$MERGED"
179 fi
180 return 0
181 ;;
182 [rR]*)
183 if ! remote_present
184 then
185 if test -n "$(git ls-tree MERGE_HEAD -- "$MERGED")"
186 then
187 # Remote isn't present, but it's a subdirectory
188 git ls-tree --full-name -r MERGE_HEAD -- "$MERGED" |
189 git update-index --index-info || exit $?
190 else
191 test -e "$MERGED" && mv -- "$MERGED" "$BACKUP"
192 git update-index --force-remove "$MERGED"
193 fi
194 elif is_submodule "$remote_mode"
195 then
196 ! is_submodule "$local_mode" &&
197 test -e "$MERGED" &&
198 mv -- "$MERGED" "$BACKUP"
199 stage_submodule "$MERGED" "$remote_sha1"
200 else
201 test -e "$MERGED" && mv -- "$MERGED" "$BACKUP"
202 git checkout-index -f --stage=3 -- "$MERGED"
203 git add -- "$MERGED"
204 fi
Jonathon Mahff7f0892011-04-13 03:00:48 -0700205 cleanup_temp_files --save-backup
Junio C Hamanof8750a02012-08-22 22:33:15 -0700206 return 0
207 ;;
208 [aA]*)
209 return 1
210 ;;
211 esac
Jonathon Mahff7f0892011-04-13 03:00:48 -0700212 done
213}
214
215stage_submodule () {
Junio C Hamanof8750a02012-08-22 22:33:15 -0700216 path="$1"
217 submodule_sha1="$2"
218 mkdir -p "$path" ||
219 die "fatal: unable to create directory for module at $path"
220 # Find $path relative to work tree
221 work_tree_root=$(cd_to_toplevel && pwd)
222 work_rel_path=$(cd "$path" &&
223 GIT_WORK_TREE="${work_tree_root}" git rev-parse --show-prefix
224 )
225 test -n "$work_rel_path" ||
226 die "fatal: unable to get path of module $path relative to work tree"
227 git update-index --add --replace --cacheinfo 160000 "$submodule_sha1" "${work_rel_path%/}" || die
Jonathon Mahff7f0892011-04-13 03:00:48 -0700228}
229
Charles Bailey0ec7b6c2009-01-21 22:57:48 +0000230checkout_staged_file () {
Johannes Sixt8b014652019-06-12 18:33:47 +0200231 tmpfile="$(git checkout-index --temp --stage="$1" "$2" 2>/dev/null)" &&
232 tmpfile=${tmpfile%%' '*}
Charles Bailey0ec7b6c2009-01-21 22:57:48 +0000233
Elia Pinto1cb49372014-06-06 07:55:51 -0700234 if test $? -eq 0 && test -n "$tmpfile"
Junio C Hamanof8750a02012-08-22 22:33:15 -0700235 then
236 mv -- "$(git rev-parse --show-cdup)$tmpfile" "$3"
237 else
238 >"$3"
239 fi
Charles Bailey0ec7b6c2009-01-21 22:57:48 +0000240}
241
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -0500242merge_file () {
Junio C Hamanof8750a02012-08-22 22:33:15 -0700243 MERGED="$1"
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -0500244
Junio C Hamanof8750a02012-08-22 22:33:15 -0700245 f=$(git ls-files -u -- "$MERGED")
246 if test -z "$f"
247 then
248 if test ! -f "$MERGED"
249 then
250 echo "$MERGED: file not found"
251 else
252 echo "$MERGED: file does not need merging"
253 fi
254 return 1
255 fi
256
Johannes Sixt8b014652019-06-12 18:33:47 +0200257 # extract file extension from the last path component
258 case "${MERGED##*/}" in
259 *.*)
260 ext=.${MERGED##*.}
261 BASE=${MERGED%"$ext"}
262 ;;
263 *)
David Aguilareab335c2014-10-10 01:19:47 -0700264 BASE=$MERGED
265 ext=
Johannes Sixt8b014652019-06-12 18:33:47 +0200266 esac
David Aguilar8f0cb412014-10-11 10:04:45 -0700267
268 mergetool_tmpdir_init
269
270 if test "$MERGETOOL_TMPDIR" != "."
271 then
272 # If we're using a temporary directory then write to the
273 # top-level of that directory.
274 BASE=${BASE##*/}
275 fi
276
277 BACKUP="$MERGETOOL_TMPDIR/${BASE}_BACKUP_$$$ext"
278 LOCAL="$MERGETOOL_TMPDIR/${BASE}_LOCAL_$$$ext"
279 REMOTE="$MERGETOOL_TMPDIR/${BASE}_REMOTE_$$$ext"
280 BASE="$MERGETOOL_TMPDIR/${BASE}_BASE_$$$ext"
Junio C Hamanof8750a02012-08-22 22:33:15 -0700281
Johannes Sixt7e6d6f72019-06-12 18:33:48 +0200282 base_mode= local_mode= remote_mode=
283
284 # here, $IFS is just a LF
285 for line in $f
286 do
287 mode=${line%% *} # 1st word
288 sha1=${line#"$mode "}
289 sha1=${sha1%% *} # 2nd word
290 case "${line#$mode $sha1 }" in # remainder
291 '1 '*)
292 base_mode=$mode
293 ;;
294 '2 '*)
295 local_mode=$mode local_sha1=$sha1
296 ;;
297 '3 '*)
298 remote_mode=$mode remote_sha1=$sha1
299 ;;
300 esac
301 done
Junio C Hamanof8750a02012-08-22 22:33:15 -0700302
303 if is_submodule "$local_mode" || is_submodule "$remote_mode"
304 then
305 echo "Submodule merge conflict for '$MERGED':"
Junio C Hamanof8750a02012-08-22 22:33:15 -0700306 describe_file "$local_mode" "local" "$local_sha1"
307 describe_file "$remote_mode" "remote" "$remote_sha1"
308 resolve_submodule_merge
309 return
310 fi
311
David Aguilarfaaab8d2016-03-09 23:13:58 -0800312 if test -f "$MERGED"
313 then
314 mv -- "$MERGED" "$BACKUP"
315 cp -- "$BACKUP" "$MERGED"
316 fi
317 # Create a parent directory to handle delete/delete conflicts
318 # where the base's directory no longer exists.
319 mkdir -p "$(dirname "$MERGED")"
Junio C Hamanof8750a02012-08-22 22:33:15 -0700320
321 checkout_staged_file 1 "$MERGED" "$BASE"
322 checkout_staged_file 2 "$MERGED" "$LOCAL"
323 checkout_staged_file 3 "$MERGED" "$REMOTE"
324
Elia Pinto1cb49372014-06-06 07:55:51 -0700325 if test -z "$local_mode" || test -z "$remote_mode"
Junio C Hamanof8750a02012-08-22 22:33:15 -0700326 then
327 echo "Deleted merge conflict for '$MERGED':"
328 describe_file "$local_mode" "local" "$LOCAL"
329 describe_file "$remote_mode" "remote" "$REMOTE"
330 resolve_deleted_merge
David Aguilarfaaab8d2016-03-09 23:13:58 -0800331 status=$?
332 rmdir -p "$(dirname "$MERGED")" 2>/dev/null
333 return $status
Junio C Hamanof8750a02012-08-22 22:33:15 -0700334 fi
335
336 if is_symlink "$local_mode" || is_symlink "$remote_mode"
337 then
338 echo "Symbolic link merge conflict for '$MERGED':"
339 describe_file "$local_mode" "local" "$LOCAL"
340 describe_file "$remote_mode" "remote" "$REMOTE"
341 resolve_symlink_merge
342 return
343 fi
344
345 echo "Normal merge conflict for '$MERGED':"
346 describe_file "$local_mode" "local" "$LOCAL"
347 describe_file "$remote_mode" "remote" "$REMOTE"
Felipe Contreras4ecc63d2014-04-20 19:17:34 -0500348 if test "$guessed_merge_tool" = true || test "$prompt" = true
Junio C Hamanof8750a02012-08-22 22:33:15 -0700349 then
350 printf "Hit return to start merge resolution tool (%s): " "$merge_tool"
351 read ans || return 1
352 fi
353
354 if base_present
355 then
356 present=true
Theodore Ts'oce5b6d72007-03-27 18:00:03 -0400357 else
Junio C Hamanof8750a02012-08-22 22:33:15 -0700358 present=false
Charles Bailey162eba82008-12-12 21:48:41 +0000359 fi
360
Junio C Hamanof8750a02012-08-22 22:33:15 -0700361 if ! run_merge_tool "$merge_tool" "$present"
362 then
363 echo "merge of $MERGED failed" 1>&2
364 mv -- "$BACKUP" "$MERGED"
Charles Bailey44c36d12008-02-21 23:30:02 +0000365
Junio C Hamanof8750a02012-08-22 22:33:15 -0700366 if test "$merge_keep_temporaries" = "false"
367 then
368 cleanup_temp_files
369 fi
Charles Bailey44c36d12008-02-21 23:30:02 +0000370
Junio C Hamanof8750a02012-08-22 22:33:15 -0700371 return 1
372 fi
373
374 if test "$merge_keep_backup" = "true"
375 then
376 mv -- "$BACKUP" "$MERGED.orig"
377 else
378 rm -- "$BACKUP"
379 fi
380
381 git add -- "$MERGED"
382 cleanup_temp_files
383 return 0
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -0500384}
385
Junio C Hamanof8750a02012-08-22 22:33:15 -0700386prompt_after_failed_merge () {
387 while true
388 do
Nikola Forrócce076e2016-04-12 16:44:20 +0200389 printf "Continue merging other unresolved paths [y/n]? "
Junio C Hamanof8750a02012-08-22 22:33:15 -0700390 read ans || return 1
391 case "$ans" in
392 [yY]*)
393 return 0
394 ;;
395 [nN]*)
396 return 1
397 ;;
398 esac
399 done
Charles Baileyb0169d82008-12-12 21:48:40 +0000400}
Steffen Prohaskae3fa2c72007-10-17 19:16:11 +0200401
David Aguilar57937f72016-10-07 16:58:05 -0700402print_noop_and_exit () {
403 echo "No files need merging"
404 exit 0
405}
406
David Aguilar08221e32016-10-07 16:58:04 -0700407main () {
408 prompt=$(git config --bool mergetool.prompt)
Denton Liu05fb8722019-04-29 02:21:08 -0400409 GIT_MERGETOOL_GUI=false
David Aguilar08221e32016-10-07 16:58:04 -0700410 guessed_merge_tool=false
David Aguilar654311b2016-10-07 17:01:30 -0700411 orderfile=
Charles Bailey7bfb7c32014-10-11 01:39:37 -0700412
David Aguilar08221e32016-10-07 16:58:04 -0700413 while test $# != 0
414 do
415 case "$1" in
416 --tool-help=*)
417 TOOL_MODE=${1#--tool-help=}
418 show_tool_help
419 ;;
420 --tool-help)
421 show_tool_help
422 ;;
423 -t|--tool*)
424 case "$#,$1" in
425 *,*=*)
Johannes Sixt8b014652019-06-12 18:33:47 +0200426 merge_tool=${1#*=}
David Aguilar08221e32016-10-07 16:58:04 -0700427 ;;
428 1,*)
429 usage ;;
430 *)
431 merge_tool="$2"
432 shift ;;
433 esac
434 ;;
Denton Liu063f2bd2018-10-24 12:25:31 -0400435 --no-gui)
Denton Liu05fb8722019-04-29 02:21:08 -0400436 GIT_MERGETOOL_GUI=false
Denton Liu063f2bd2018-10-24 12:25:31 -0400437 ;;
438 -g|--gui)
Denton Liu05fb8722019-04-29 02:21:08 -0400439 GIT_MERGETOOL_GUI=true
Denton Liu063f2bd2018-10-24 12:25:31 -0400440 ;;
David Aguilar08221e32016-10-07 16:58:04 -0700441 -y|--no-prompt)
442 prompt=false
443 ;;
444 --prompt)
445 prompt=true
446 ;;
David Aguilar654311b2016-10-07 17:01:30 -0700447 -O*)
Richard Hansenc1b0d3a2017-01-10 15:42:01 -0500448 orderfile="${1#-O}"
David Aguilar654311b2016-10-07 17:01:30 -0700449 ;;
David Aguilar08221e32016-10-07 16:58:04 -0700450 --)
451 shift
452 break
453 ;;
454 -*)
455 usage
456 ;;
457 *)
458 break
459 ;;
460 esac
461 shift
462 done
463
464 git_dir_init
465 require_work_tree
466
Felipe Contreras4ecc63d2014-04-20 19:17:34 -0500467 if test -z "$merge_tool"
468 then
Denton Liu05fb8722019-04-29 02:21:08 -0400469 if ! merge_tool=$(get_merge_tool)
David Aguilar08221e32016-10-07 16:58:04 -0700470 then
David Aguilar08221e32016-10-07 16:58:04 -0700471 guessed_merge_tool=true
472 fi
Felipe Contreras4ecc63d2014-04-20 19:17:34 -0500473 fi
David Aguilar08221e32016-10-07 16:58:04 -0700474 merge_keep_backup="$(git config --bool mergetool.keepBackup || echo true)"
475 merge_keep_temporaries="$(git config --bool mergetool.keepTemporaries || echo false)"
Theodore Ts'oc4b4a5a2007-03-06 00:05:16 -0500476
Richard Hansend0e0cfe2017-01-10 15:42:02 -0500477 prefix=$(git rev-parse --show-prefix) || exit 1
478 cd_to_toplevel
479
480 if test -n "$orderfile"
481 then
482 orderfile=$(
483 git rev-parse --prefix "$prefix" -- "$orderfile" |
484 sed -e 1d
485 )
486 fi
487
David Aguilar57937f72016-10-07 16:58:05 -0700488 if test $# -eq 0 && test -e "$GIT_DIR/MERGE_RR"
Junio C Hamanof8750a02012-08-22 22:33:15 -0700489 then
David Aguilar57937f72016-10-07 16:58:05 -0700490 set -- $(git rerere remaining)
491 if test $# -eq 0
David Aguilar08221e32016-10-07 16:58:04 -0700492 then
David Aguilar57937f72016-10-07 16:58:05 -0700493 print_noop_and_exit
David Aguilar08221e32016-10-07 16:58:04 -0700494 fi
Richard Hansend0e0cfe2017-01-10 15:42:02 -0500495 elif test $# -ge 0
496 then
497 # rev-parse provides the -- needed for 'set'
498 eval "set $(git rev-parse --sq --prefix "$prefix" -- "$@")"
Junio C Hamanof8750a02012-08-22 22:33:15 -0700499 fi
Charles Baileyb0169d82008-12-12 21:48:40 +0000500
David Aguilar57937f72016-10-07 16:58:05 -0700501 files=$(git -c core.quotePath=false \
David Aguilar654311b2016-10-07 17:01:30 -0700502 diff --name-only --diff-filter=U \
Richard Hansenc1b0d3a2017-01-10 15:42:01 -0500503 ${orderfile:+"-O$orderfile"} -- "$@")
David Aguilar57937f72016-10-07 16:58:05 -0700504
David Aguilar08221e32016-10-07 16:58:04 -0700505 if test -z "$files"
Junio C Hamanof8750a02012-08-22 22:33:15 -0700506 then
David Aguilar57937f72016-10-07 16:58:05 -0700507 print_noop_and_exit
Junio C Hamanof8750a02012-08-22 22:33:15 -0700508 fi
Jonathon Mah3e8e6912011-09-15 19:12:10 -0700509
David Aguilar08221e32016-10-07 16:58:04 -0700510 printf "Merging:\n"
511 printf "%s\n" "$files"
512
513 rc=0
Nicholas Gurievd651a542018-08-13 08:09:29 +0300514 set -- $files
515 while test $# -ne 0
David Aguilar08221e32016-10-07 16:58:04 -0700516 do
517 printf "\n"
Nicholas Gurievd651a542018-08-13 08:09:29 +0300518 if ! merge_file "$1"
David Aguilar08221e32016-10-07 16:58:04 -0700519 then
520 rc=1
Nicholas Gurievd651a542018-08-13 08:09:29 +0300521 test $# -ne 1 && prompt_after_failed_merge || exit 1
David Aguilar08221e32016-10-07 16:58:04 -0700522 fi
Nicholas Gurievd651a542018-08-13 08:09:29 +0300523 shift
David Aguilar08221e32016-10-07 16:58:04 -0700524 done
525
526 exit $rc
527}
528
529main "$@"