GNU bug report logs - #72536
[PATCH] tap: new `--merge-prefix' option to prefix stderr before merging

Previous Next

Package: automake-patches;

Reported by: Richard Hansen <rhansen <at> rhansen.org>

Date: Fri, 9 Aug 2024 08:40:01 UTC

Severity: normal

Tags: patch

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Richard Hansen <rhansen <at> rhansen.org>
To: jcb62281 <at> gmail.com
Cc: 72536 <at> debbugs.gnu.org
Subject: [bug#72536] [PATCH] tap: new `--merge-prefix' option to prefix stderr before merging
Date: Sat, 10 Aug 2024 02:55:00 -0400
[Message part 1 (text/plain, inline)]
On 2024-08-09 22:47:32-04:00, Jacob Bachmeyer wrote:
> I would suggest `--label-stderr' or `--stderr-message-prefix' as better 
> option names to open a discussion.  The main problem I see with 
> `--merge-prefix' is that it is using "merge" in a sense that can only be 
> understood with the detailed context of what the TAP driver does.

Good point.  How about `--stderr-prefix`?  The downside to not including 
"merge" in the option name is that it isn't obviously tied to the 
`--merge` option.

I could make this option independent of `--merge` and always prefix each 
line of the test script's stderr.  That would make it easier for users 
to understand the option's behavior, even if it would rarely be used 
without `--merge`.

Or I could change it to something like `--merge-with-prefix` and have it 
automatically turn on `--merge`.


On a separate note, it's difficult to portably add a `#` character to a 
make variable, as you can see in the test I added.  Yet that is the one 
character that users will almost certainly want to include in the 
prefix.  I wonder if this should have a default prefix so that users 
don't have to figure out how to pass `#`.  Maybe something like:

  * `--stderr-prefix` by itself to prefix with the default of `# `
  * `--stderr-prefix custom-prefix` to prefix with `custom-prefix`

This would be a bit more complicated to implement because the script 
would need a heuristic to determine whether the user passed a custom 
prefix or not (such as, "there is an argument after `--stderr-prefix` 
and that argument does not begin with `-`").

-Richard


p.s. I requested a copyright assignment form.
[OpenPGP_signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 96 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.