Eric Blake wrote:
Slightly better, but what about:
m4 --some-option --lt-...
You don't know whether --some-option takes an argument, and the developer
really intended to pass the literal string --lt-... as the argument to
that option, or if --some-option takes no argument, so --lt-... is a true
wrapper option. I'd really feel more comfortable if all --lt-* were
leading, since otherwise the wrapper can't distinguish options from option
arguments.
It seems more clear to me, if we simply assert "all options in the
--lt-* namespace (or configure-time/LT_INIT option
--ltwrapper-option-namespace=) belong to the wrapper". The target is NOT
allowed to use them.
(1) --lt-* has got to be pretty rare. But, on the off-chance that there
exists SOME package out there that really really really must use options
in that space, or reasonably expects arguments TO options, where the
arguments might be in that space, then SURELY
(2) there is SOME random string of characters that the developers of
that package can come up with, that won't clash with their program
options, nor with any meaningful option arguments. And they can use the
configure-time option
--ltwrapper-option-namespace=ugly-blather-guaranteed-not-to-clash or
LT_INIT([... ltwrapper-option-namespace=ugly-blather ...]) and force
wrapper users who want to manipulate the wrapper to say
--ugly-blather-guaranteed-not-to-clash-env-set
--ugly-blather-guaranteed-not-to-clash-env-prepend
--ugly-blather-guaranteed-not-to-clash-env-append
etc.
As far as options with/without arguments, it's very simple: the wrapper
gets first crack, and REMOVES all options (and /their/ arguments) from
the passed-on argv vector. Thus:
wrapper.exe --lt-env-set foo=bar --opt1 --lt-env-set=baz=jump
arg1_for_opt1 --lt-env-append=bob=fred arg2_for_opt1 -o -b another_arg
--lt-env-prepend PATH=local_path
turns in to
target.exe --opt1 arg1_for_opt1 arg2_for_opt1 -o -b another_arg
Having a configurable wrapper namespace sounds nice, but not mandatory.
The '--' issue aside, you're the one worried about possible clashes with
the --lt-* option namespace. The obvious way around that is to let those
packages which clash to have a way to move the lt option namespace into
a non-clashing area.
--
Chuck