William L. Thomson Jr. wrote:
> On Sat, 2008-06-07 at 00:42 +0200, Vlastimil Babka wrote:
>> There could be also switch to add newline
>> before the message but I can't think of a use for it myself.
>> The question is how to name the switch :) "-n" could be confusing as
>> "echo -n" has the opposite effect. Maybe "-b" for "blank"?
>
> Or -p for preceding -t for trailing. Which would make one liner
>
> elog -pt "One line with blank ones before and after"
The comment from Vlastimil about echo not being part of the elog system
is a very valid point indeed. As for how to specify that a newline
should be inserted, I think that using elog switches like "-n", "-p",
etc., as well as putting more than one string on a line present two
problems: the newline would be "connected" with the "elog" or "ewarn"
(or whatever style of output was chosen) and it would also potentially
make the ebuild code harder to read/debug. For example, if you have a
block of "ewarn" lines, then a blank line, then a block of "elog" lines,
you would have to decide in which style to place the special switch (so
portage would not have the opportunity to do auto-context
coloring/formatting).
I personally would prefer a new command like "eseparator" that could be
treated "smartly" by portage, taking on the appropriate color based on
what is before and after. It could also avoid multiple newlines in the
case in which two eseparator lines occur together due to pattern of
conditional blocks in the ebuild invoked under certain circumstances (I
have found this hard to code in a way that covers all possibilities, as
I mentioned before). Also, separators at the very beginning or very end
of all lines output by the ebuild could be handled consistently (either
ignored or collapsed into an implicit separator, as appropriate) by
portage to produce nice output.
-Joe
--
[email protected] mailing list