[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "openapp AppName.app" versus "openapp ./AppName.app"
From: |
Niels Grewe |
Subject: |
Re: "openapp AppName.app" versus "openapp ./AppName.app" |
Date: |
Sat, 31 Dec 2011 20:36:54 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16 |
Am 31.12.2011 20:05, schrieb Ivan Vučica:
> Hi all,
>
> I find it rather annoying to have to type "openapp ./AppName.app". I
> propose the following patch for openapp, in interest of easier use of
> bash autocomplete.
>
> Index: openapp.in <http://openapp.in>
> ===================================================================
> --- openapp.in <http://openapp.in> (revision 34347)
> +++ openapp.in <http://openapp.in> (working copy)
> @@ -246,7 +246,8 @@
> if [ -z "$openapp_full_appname" ]; then
> echo "Can't find the required application: $openapp_app!"
> if [ -d "./$openapp_app" ]; then
> - echo "There is a $openapp_app in this directory; please use
> 'openapp ./$openapp_app' if you want to open it!"
> + echo "Using $0 \"./$openapp_app\""
> + exec "$0" "./$openapp_app"
> fi
> exit 1
> fi
>
> It's most definitely far from perfect, considering it does not pass any
> arguments appearing after app name. However, it's good enough for most
> of the cases, especially since it throws a warning which should help the
> developer that needs that feature understand why the arguments are not
> passed on.
>
> It is definitely more helpful than previous behavior, and I can't think
> of any downsides.
You mean apart from the apparent downside of opening a security hole
that allows somebody to plant a malicious app bundle in the cwd? By the
same rationale, you shouldn't have "." in your PATH, despite of the
minor inconvenience.
Cheers,
Niels