You can view, comment on, or merge this pull request online at:https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/408 Commit Summary
File ChangesPatch Links:
— |
@fniephaus requested changes on this pull request. In platforms/unix/config/bin.squeak.sh.in: > @@ -53,4 +53,15 @@ case $PLATFORMLIBDIR in /lib|/usr/lib) SVMLLP=/lib:/usr/lib;; *) SVMLLP="$PLATFORMLIBDIR:/lib:/usr$PLATFORMLIBDIR:/usr/lib" esac -LD_LIBRARY_PATH="$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH}" exec $GDB "$BIN/squeak" "$@" + +# If no image file is provided as a command-line argument, allow the user to +# select the image file via a file-chooser dialog +if which zenity &>/dev/null && [ $# -eq 0 ]; then Could you please swap left and right? No need to check if In platforms/unix/config/bin.squeak.sh.in: > @@ -53,4 +53,15 @@ case $PLATFORMLIBDIR in /lib|/usr/lib) SVMLLP=/lib:/usr/lib;; *) SVMLLP="$PLATFORMLIBDIR:/lib:/usr$PLATFORMLIBDIR:/usr/lib" esac -LD_LIBRARY_PATH="$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH}" exec $GDB "$BIN/squeak" "$@" + +# If no image file is provided as a command-line argument, allow the user to +# select the image file via a file-chooser dialog +if which zenity &>/dev/null && [ $# -eq 0 ]; then + IMAGE=$(zenity --title 'Select an image' --file-selection --filename "${RESOURCES}/" --file-filter '*.image' --file-filter '*')
In platforms/unix/config/bin.squeak.sh.in: > @@ -53,4 +53,15 @@ case $PLATFORMLIBDIR in /lib|/usr/lib) SVMLLP=/lib:/usr/lib;; *) SVMLLP="$PLATFORMLIBDIR:/lib:/usr$PLATFORMLIBDIR:/usr/lib" esac -LD_LIBRARY_PATH="$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH}" exec $GDB "$BIN/squeak" "$@" + +# If no image file is provided as a command-line argument, allow the user to +# select the image file via a file-chooser dialog +if which zenity &>/dev/null && [ $# -eq 0 ]; then + IMAGE=$(zenity --title 'Select an image' --file-selection --filename "${RESOURCES}/" --file-filter '*.image' --file-filter '*') +else + IMAGE=$@ +fi + +echo "Using image: ${IMAGE}" Please remove this print message. In platforms/unix/config/squeak.sh.in: > @@ -53,4 +53,15 @@ case $PLATFORMLIBDIR in /lib|/usr/lib) SVMLLP=/lib:/usr/lib;; *) SVMLLP="$PLATFORMLIBDIR:/lib:/usr$PLATFORMLIBDIR:/usr/lib" esac -LD_LIBRARY_PATH="$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH}" exec $GDB "$BIN/squeak" "$@" See comments for other file... — |
In reply to this post by David T Lewis
@MrModder pushed 1 commit.
— |
In reply to this post by David T Lewis
@MrModder pushed 1 commit.
— |
In reply to this post by David T Lewis
Hi Leon,
if [ $# -eq 0 && which zenity &>/dev/null ]; then
That's illustrated by the following test programme: If one invokes this with ./testshellargs.sh 'arg one' 'arg two' then the output is A B C D We have to find some way of writing this so that the output is — |
In reply to this post by David T Lewis
Hi Leon, the only way I know of doing this is to expand $@ within double quotes at the point of command dispatch. Here's the illustration of the magic incantation: ZENITY_ARGS= so the right form would be ZENITY_ARGS= LD_LIBRARY_PATH="$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH}" exec $GDB "$BIN/squeak" ${ZENITY_ARGS:="$@"} — |
> On 2019-06-28, at 6:05 PM, Eliot Miranda <[hidden email]> wrote: > > ZENITY_ARGS=$(zenity --title 'Select an image' --file-selection --file-filter '.image' --file-filter '') > fi Just a small flag-waving point - on a Pi, at least, that needs to be --file-selection '*.image' to actually show any image files. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Plan to be spontaneous tomorrow. |
Free forum by Nabble | Edit this page |