Martin Gasbichler <gasbichl@informatik.uni-tuebingen.de> writes:
> Michel Schinz <Michel.Schinz@epfl.ch> writes:
[...]
>> I think it's generally useful to have that, yes. I wonder, however, if
>> this could not be simply integrated in scsh itself, via some new
>> options (say "scsh -config ..."). I tend to prefer that solution
>> simply because it puts one less executable in the path, but that's a
>> detail.
>
> I wonder why other people did not choose this way but provided
> separate executables?
I have no idea. Maybe, on some occasions, the "-config" tool can be
significantly smaller than the main tool, and start faster. In our
case, though, since scsh-config is a scsh script, it is actually the
other way around.
>> Now that I think about it, why not do the following:
>>
>> - make all configuration parameters accessible in scsh through
>> variables or functions,
>
> What exactly do you mean by configuration parameter? The variables
> substituted into the Makefile by configure or more complex stuff like
> the output of scsh-config --libs?
I guess that what's currently available through scsh-config should at
least be available easily (i.e. through a single variable access or
function call), otherwise it will be painful to use. As far as the
rest is concerned (i.e. "configure" variables), if there is a use for
them they could be provided, but I don't know if it is the case.
[...]
> So all you would save by adding another command line option instead
> of using the -c option is a call to DISPLAY? That sounds like a
> waste of command line options to me...
Yes, that's all you would save, but it includes a pair of parenthesis,
and often a pair of quotes to prevent the shell from interpreting the
parenthesis. Thus, you would write this:
scsh -p scsh-config-libs
instead of that:
scsh -c '(display scsh-config-libs)'
(and in fact, the last line above has a slight problem: DISPLAY
doesn't put an end-of-line at the end of its output, which means that
when used interactively, the output of the above command gets at least
partially overwritten by the next shell prompt. So you might want to
write this instead:
scsh -c '(begin (display scsh-config-libs) (newline))'
in which case the savings become consequent. But that's only for
interactive use, and one typically doesn't use these commands
interactively).
I agree that, unless you take interactive use into consideration, the
differences are small, and one could use -c easily.
Michel.
|