mirror of https://github.com/zulip/zulip.git
push-to-pull-request: Use getopts for macOS compatibility.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
130aecbf9e
commit
474703a963
|
@ -26,28 +26,34 @@ See also \`reset-to-pull-request\`.
|
|||
EOF
|
||||
}
|
||||
|
||||
args="$(getopt -o '' --long help,merge -n "$0" -- "$@")"
|
||||
eval "set -- $args"
|
||||
|
||||
merge=
|
||||
|
||||
while true; do
|
||||
case "$1" in
|
||||
--help)
|
||||
usage
|
||||
exit 0
|
||||
while getopts ":-:" opt; do
|
||||
case $opt in
|
||||
-)
|
||||
case "$OPTARG" in
|
||||
help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
merge)
|
||||
merge=t
|
||||
;;
|
||||
*)
|
||||
echo "Invalid option: --$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
--merge)
|
||||
merge=t
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
remote_default="$(git config zulip.zulipRemote || echo upstream)"
|
||||
pseudo_remote="$(git config zulip.prPseudoRemote || echo)"
|
||||
|
||||
|
|
Loading…
Reference in New Issue