Changed non-tty output to BARE instead of PLAIN

This commit is contained in:
Bruce Hill 2021-09-04 14:09:20 -07:00
parent 900466c483
commit 58fef531eb
3 changed files with 4 additions and 4 deletions

4
bp.1
View File

@ -1,4 +1,4 @@
.\" Automatically generated by Pandoc 2.14.0.2
.\" Automatically generated by Pandoc 2.14.2
.\"
.TH "BP" "1" "May 17 2021" "" ""
.hy
@ -81,7 +81,7 @@ Set the output format.
line numbers with no coloring, \f[I]bare\f[R] prints only the match
text, \f[I]file:line\f[R] prints the filename and line number for each
match (grep-style), and \f[I]auto\f[R] (the default) uses
\f[I]fancy\f[R] formatting when the output is a TTY and \f[I]plain\f[R]
\f[I]fancy\f[R] formatting when the output is a TTY and \f[I]bare\f[R]
formatting otherwise.
.TP
\f[B]-h\f[R], \f[B]--help\f[R]

View File

@ -77,7 +77,7 @@ all text before and after each match.
prints line numbers with no coloring, *bare* prints only the match text,
*file:line* prints the filename and line number for each match (grep-style),
and *auto* (the default) uses *fancy* formatting when the output is a TTY and
*plain* formatting otherwise.
*bare* formatting otherwise.
`-h`, `--help`
: Print the usage and exit.

2
bp.c
View File

@ -521,7 +521,7 @@ int main(int argc, char *argv[])
if (options.context_after == USE_DEFAULT_CONTEXT) options.context_after = 0;
if (options.format == FORMAT_AUTO)
options.format = isatty(STDOUT_FILENO) ? FORMAT_FANCY : FORMAT_PLAIN;
options.format = isatty(STDOUT_FILENO) ? FORMAT_FANCY : FORMAT_BARE;
// If any of these signals triggers, and there is a temporary file in use,
// be sure to clean it up before exiting.