runphp: passer les arguments inchangés à composer

This commit is contained in:
Jephté Clain 2025-03-03 09:25:22 +04:00
parent 9def939cf1
commit 7e05caf4d7

View File

@ -455,15 +455,18 @@ OPTIONS
function host_docker_run() { function host_docker_run() {
# lancer une commande avec docker # lancer une commande avec docker
SOPTS=+w: if [ "$1" == composer ]; then
LOPTS=help,chdir:,no-use-rslave : # pas d'analyse d'argument pour composer
args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args" else
SOPTS=+w:
LOPTS=help,chdir:,no-use-rslave
args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args"
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
--) shift; break;; --) shift; break;;
--help) --help)
eecho "\ eecho "\
runphp: lancer une commande dans un environnement PHP déterminé runphp: lancer une commande dans un environnement PHP déterminé
USAGE USAGE
@ -490,14 +493,15 @@ OPTIONS
aller dans le répertoire spécifié avant de lancer la commande aller dans le répertoire spécifié avant de lancer la commande
--no-use-rslave --no-use-rslave
paramètre montage des volumes" paramètre montage des volumes"
exit 0 exit 0
;; ;;
-w|--chdir) shift; Chdir="$1";; -w|--chdir) shift; Chdir="$1";;
--no-use-rslave) UseRslave=;; --no-use-rslave) UseRslave=;;
*) die "$1: option non configurée";; *) die "$1: option non configurée";;
esac esac
shift shift
done done
fi
args=( args=(
run -it --rm run -it --rm
@ -573,20 +577,24 @@ function container_exec() {
fi fi
fi fi
SOPTS=+w: if [ "$1" == composer ]; then
LOPTS=chdir: : # pas d'analyse d'argument pour composer
args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args" else
SOPTS=+w:
LOPTS=chdir:
args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args"
chdir= chdir=
action= action=
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
--) shift; break;; --) shift; break;;
-w|--chdir) shift; chdir="$1";; -w|--chdir) shift; chdir="$1";;
*) die "$1: option non configurée";; *) die "$1: option non configurée";;
esac esac
shift shift
done done
fi
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
die "no command specified" die "no command specified"