elves / elvish

Powerful scripting language & versatile interactive shell
https://elv.sh/
BSD 2-Clause "Simplified" License
5.67k stars 300 forks source link

Customizable error message formats #460

Open ALSchwalm opened 7 years ago

ALSchwalm commented 7 years ago

@xiaq mentioned in #458 that it would be a good idea to allow different error formats, and I agree. I wanted to go ahead and make an issue for this to get some details worked out before doing any implementation. I see a few possible options for format:

Running elvish somefile.elv on a file with contents $test would produce the following errors in each format:

I think no format should produce multiple errors in one output. So the current "multiple parse errors in ..." would instead use multiple lines. I'm also expressing things in terms of line-column because I think that is much more common than start-end file position.

Thoughts?

krader1961 commented 4 years ago

Hmmm. I'm not sure there is any value in implementing this as a user selectable operational mode. In normal shell use the current verbose output should be used. If the -compileonly option is used it probably makes more sense to always use JSON as shown in the opening comment to facilitate integrating that output into other tools.