go-internal icon indicating copy to clipboard operation
go-internal copied to clipboard

testscript: mention when `-continue` is used [feature request]

Open jpluscplusm opened this issue 1 year ago • 1 comments

Feature request

Add some mention of the fact that -continue is in effect, in the testscript command's output to stdout.

Rationale

When I create a txtar repro and need to capture its actual ("not as expected") output, I can invoke testscript foo.txt | wl-copy (where wl-copy is a command that places its input into my copy/paste buffer) and paste the output directly into the issue I'm opening.

However, whenever the narrative flow in my repro requires the use of -continue, I need to:

  • invoke testscript -continue foo.txt | wl-copy
  • paste the output into the body of the issue I'm opening
  • switch back to the terminal
  • copy the first element of the invocation
  • paste the invoked command as a preamble to the testscript output
  • fix up the command by adding a $ prefix, indicating it's a command to the reader.

In other words: to nicely inform the reader that they're about to see a testscript -continue invocation, I need to manually add it before the record of the command's output as I can't rely on the command's stdout to indicate that the flag is present.

Sure, I could assume that the reader should be able to infer the presence of -continue from the presence of multiple FAIL:-prefixed lines, but I don't think I'm the only person to feel an obligation to make it clearer. I've definitely seen examples of other folks manually adding the testscript -continue ... prefix to repros in issues in https://github.com/cue-lang/cue.

jpluscplusm avatar Jan 03 '25 09:01 jpluscplusm

What exact text would you suggest it prints in this case? In general testscript does not mention anything about what its command line was at all - there are other flags too: why does --continue deserve to be special in this respect?

rogpeppe avatar Feb 11 '25 17:02 rogpeppe