-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Consider the ugly ANSI escapes below:
jsonld lint -l FI2.jsonld |less
WARNING: Relative @type reference found.
{
type: [ ESC[32m'JsonLdEvent'ESC[39m ],
code: ESC[32m'relative @type reference'ESC[39m,
level: ESC[32m'warning'ESC[39m,
message: ESC[32m'Relative @type reference found.'ESC[39m,
details: { type: ESC[32m'$id'ESC[39m }
}
...
Why did I pipe it through less instead of enjoying the nice coloring at the terminal?
Because for this file I get 79 errors like this:
jsonld lint -l FI2.jsonld |sort|uniq -c
79 code: 'relative @type reference',
79 details: { type: '$id' }
79 level: 'warning',
79 message: 'Relative @type reference found.',
79 type: [ 'JsonLdEvent' ],
79 {
79 }
79 WARNING: Relative @type reference found.
And because quite often I want to save the output of lint to a file to share with colleagues.
So lint should inspect its STDOUT and use coloring only if it's an interactive terminal.
Or have an option to omit coloring.
Version:
jsonld -V
2.0.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels