gst-inspect: Colored output

Let's make the output a bit pretty to read. The colored output can be
disabled with `--no-colors` option or by setting `GST_INSPECT_NO_COLORS'
env (to any value).

The chosen colors are based on the popular Solarized theme, which is
targeted for both dark and light backgrounds.

Note:

* We only support true colors. If the terminal doesn't signal support for
  that via 'COLORTERM' env, we disable colored output.

* We don't add colors to --print-plugin-auto-install-info output, as
  that's meant for machines, not humans. Not only machines don't care
  about beauty, the existing ones will likely not expect colors and choke
  on it and we'll get angry mob at our doors.

[1] https://ethanschoonover.com/solarized
This commit is contained in:
Zeeshan Ali 2018-10-27 18:06:20 +01:00
parent d3811ca5cd
commit 2cf16838c5
2 changed files with 396 additions and 196 deletions

View file

@ -57,6 +57,10 @@ is at least the version specified
.B \-u, \-\-uri\-handlers .B \-u, \-\-uri\-handlers
Print supported URI schemes, with the elements that implement them Print supported URI schemes, with the elements that implement them
.TP 8 .TP 8
.B \-u, \-\-no\-colors
Disable colors in output. You can also achieve the same by setting
\'GST_INSPECT_NO_COLORS\' environment variable to any value.
.TP 8
.B \-\-print\-plugin\-auto\-install\-info .B \-\-print\-plugin\-auto\-install\-info
Print a machine-parsable list of features the specified plugin provides. Print a machine-parsable list of features the specified plugin provides.
Useful in connection with external automatic plugin installation mechanisms. Useful in connection with external automatic plugin installation mechanisms.

File diff suppressed because it is too large Load diff