Skip to content
Snippets Groups Projects
Commit a7f730c1 authored by Simon McVittie's avatar Simon McVittie
Browse files

Use "--" argument separator if available


I recently added that to bubblewrap.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent cfa633cd
No related branches found
No related tags found
Loading
......@@ -146,14 +146,27 @@ if [ "$#" -eq 0 ]; then
exit 2
fi
# bwrap doesn't support the -- syntax
case "$1" in
(-*)
command="$1"
shift
set -- "./$command" "$@"
;;
esac
if "$BWRAP" --help | grep -F '[--]' 2>/dev/null; then
bwrap_end_of_options="--"
else
# bwrap doesn't support the -- syntax
bwrap_end_of_options=""
case "$1" in
(-*)
case "$1" in
(*=*)
# env would interpret this as an environment variable
echo "$me: Cannot execute command '$1' with bubblewrap < 0.2.2">&2
exit 1
;;
(*)
# Emulate it via env(1)
bwrap_end_of_options="env"
;;
esac
;;
esac
fi
if [ -n "$interactive" ]; then
exec </dev/tty
......@@ -285,6 +298,6 @@ fi
# Replace this process with bwrap, which replaces itself with the
# desired command (unless exec fails)
exec "$BWRAP" "$@" || e=$?
exec "$BWRAP" $bwrap_end_of_options "$@" || e=$?
echo "$me: failed to execute '$BWRAP $*': exec status $?" >&2
exit $?
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment