I did some research and found that the command line parameters are handled inside
Console:
/usr/share/playonlinux/lib/main
I kind of understand what's happening after looking at the following section where the things are done:
Console:
if [ "$1" = "--run" ]
then
#Arg contient tout apres l'option --run
#Supporte le lancement de jeu avec option POL >> 1.7.5
Arg=$(echo $@ | cut -b7-)
Arg=${Arg//"$2 "/""}
lancer "$2" "$Arg"
exit 0
fi
The problem is the parameter replacement
, where $2 and an additional space are replaced by /"". The problem is that if $2 is the only parameter, there is no space, and nothing is replaced! Therefore the script name is transmitted twice: in $2 and in $Arg. This is probably not the desired behavior.
I replaced this code by
Console:
if [ "$1" = "--run" ]
then
#App is the name of the script to be called,
#$@" contains the rest of the parameters to be given to the script
#Supporte le lancement de jeu avec option POL >> 1.7.5
App=$2
shift
shift
lancer "$App" "$@"
exit 0
fi
I believe using "shift" twice is a better way to drop the first two command line parameters, "--run", and (following my example above), "Word 2003". Can someone please check this, I am not exactly a bash expert, but it works fine for me.
--hasi