[PATCH] Add the ability to set an output file.

Peter Collingbourne peter at pcc.me.uk
Fri Nov 15 18:10:46 PST 2013


  I see a few problems with this interface:

  1) No way to switch output back to stdout after redirecting to a file.
  2) I think error messages should either appear on the console regardless of the output file setting or be separately redirectable.  This is preferable in the case where the user is interactively collecting data into a file; it should be obvious from the console output that an error has occurred rather than the file containing an error message and wrong conclusions being drawn (perhaps by a script which doesn't check for error messages).

  I think it's pretty important to get those right from the start rather than letting people write scripts which depend on bad behaviour.

  Speaking of getting things right, I think "output" was the wrong name for that setting. Instead, I think we should rename that setting to something like output-format, and output should be the name of the output destination setting.  Strawman for syntax:

  set output file FILENAME
  set output stdout

  It would also be nice if errors opening the file were diagnosed at "set output" time, but not required.

http://llvm-reviews.chandlerc.com/D2184



More information about the cfe-commits mailing list