mirror of
https://github.com/gnustep/tools-make.git
synced 2025-04-23 22:33:28 +00:00
New --find option; updated help messages
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@15791 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
285bb4e4fa
commit
0998bd339b
1 changed files with 24 additions and 5 deletions
29
openapp.in
29
openapp.in
|
@ -27,8 +27,8 @@
|
|||
# unmodified to the application.
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo usage: `basename $0` application [--library-combo=...] [arguments...]
|
||||
echo `basename $0` --help for help
|
||||
echo usage: openapp [--find] application [arguments...]
|
||||
echo openapp --help for more help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -36,17 +36,31 @@ if [ -z "$GNUSTEP_FLATTENED" ]; then
|
|||
GNUSTEP_FLATTENED=@GNUSTEP_FLATTENED@
|
||||
fi
|
||||
|
||||
# trap the --library-combo parameter
|
||||
only_find=
|
||||
|
||||
# TODO: implement a --library-combo parameter
|
||||
case "$1" in
|
||||
--help)
|
||||
echo usage: `basename $0` application [--library-combo=...] [arguments...]
|
||||
echo usage: openapp [--find] application [arguments...]
|
||||
echo
|
||||
echo application is the complete or relative name of the application
|
||||
echo program with the .app extension, like Ink.app.
|
||||
echo program with or without the .app extension, like Ink.app.
|
||||
echo
|
||||
echo [arguments...] are the arguments to the application.
|
||||
echo
|
||||
echo If --find is used as first argument, openapp prints out
|
||||
echo the full path of the application executable which would be
|
||||
echo executed, without actually executing it as it would normally do.
|
||||
echo
|
||||
exit 0
|
||||
;;
|
||||
--find)
|
||||
only_find=yes;
|
||||
if [ -z "$2" ]; then
|
||||
echo Missing application name. Please try openapp --help for more help.
|
||||
exit 1
|
||||
fi
|
||||
app="$2"; shift; shift;;
|
||||
*)
|
||||
app="$1"; shift;;
|
||||
esac
|
||||
|
@ -160,5 +174,10 @@ if [ ! -f "$full_appname/$appname" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "$only_find" ]; then
|
||||
echo "$full_appname/$appname"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exec "$full_appname/$appname" "$@"
|
||||
|
||||
|
|
Loading…
Reference in a new issue