Add -o flag for output options for verbosity and raw output #1230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the general-purpose -o flag to address #746, with options for
verbosity (#480) and control sequence stripping (#581, #672, #916). Also
provides the ability to enable both verbose and raw output as a
workaround for #1214 without changing the existing verbose behavior.
-o verbose show all command lines while building
-o quiet hide command lines and outputs while building
-o raw never strip control sequences from output
-o strip always strip control sequences from output
-o color strip most control sequences from output, but retain color codes
This patch does not affect Ninja's defaults of normal verbosity and
smart terminal detection for escape sequence stripping.
"-o color" is particularly useful for utilities like
head
andless -R
that interpret color codes from stdin and pass this coloredoutput to stdout. Any valid ANSI color code, of the form:
where
colors
is a semicolon-delimited list of optional integers:[ n ] [ ';' colors ]
is retained in its entirety when using "-o color" (any other CSI escape
sequences besides ANSI color codes are still stripped for non-smart
terminals).