On Tue, 2002-12-03 at 04:49, Angus Leeming wrote:
> On Monday 02 December 2002 6:02 pm, Darren Freeman wrote:
> > wherever it lives I need to know the relative path to the LyX it came
> > with.. ideally people who are intrepid betatesters could alias lyx to
> > the script and it would figure out where lyx
>
> Why not invoke it with either
> $ lyxdbg
> or
> $ lyxdbg -x /usr/local/bin/lyx-1.2.2
We have that already, but don't use the -x.
The following calls are catered for (from memory):
lyxdbg
Finds LyX on a standard search path that should usually succede.
Executes it with no arguments and waits with the debugger in case of a
crash.
lyxdbg [path-to-lyx/lyx] args...
If the first argument is executable it is considered to be LyX,
otherwise the search is performed. LyX is started with variable number
of arguments args...
lyxdbg [path-to-lyx/lyx] path-to-core/core
One exception to the rule is if a valid core file is given as the
first argument other than lyx. LyX is not started, instead a post-mortem
is conducted on the core file.
> And probe the command line inside the script. Something like:
>
> EXECUTABLE=lyx
> if [ $# -ge 2 -a "$1" = "-x" ]; then
> EXECUTABLE=$2
> fi
>
> which ${EXECUTABLE} > /dev/null ||
> {
> echo "Unable to find \"${EXECUTABLE}\"."
> exit 1
> }
A good idea. I was wondering how to search the standard path. Perhaps we
will search the standard path if the other places fail. For now we
aren't using anything like "-x", instead checking if the first arg is
executable. I don't know of a case where you would pass an executable to
LyX so it shouldn't be ambiguous =) (having said that...)
> Angus
Thanks for the feedback!
Have fun,
Darren