diff --git a/Library/Homebrew/cmd/cat.rb b/Library/Homebrew/cmd/cat.rb index 15cd149d58..c7f2f4c790 100644 --- a/Library/Homebrew/cmd/cat.rb +++ b/Library/Homebrew/cmd/cat.rb @@ -25,7 +25,11 @@ module Homebrew raise "`brew cat` doesn't support multiple arguments" if args.remaining.size > 1 cd HOMEBREW_REPOSITORY - pager = ENV["HOMEBREW_VISUAL"] || "cat" + pager = if ENV["HOMEBREW_BAT"].nil? + "cat" + else + "#{HOMEBREW_PREFIX}/bin/bat" + end safe_system pager, formulae.first.path, *Homebrew.args.passthrough end end diff --git a/Library/Homebrew/manpages/brew.1.md.erb b/Library/Homebrew/manpages/brew.1.md.erb index 114a3319fa..dc8875e61d 100644 --- a/Library/Homebrew/manpages/brew.1.md.erb +++ b/Library/Homebrew/manpages/brew.1.md.erb @@ -143,6 +143,9 @@ Note that environment variables must have a value set to be detected. For exampl to retrieve these access credentials from AWS). If they are not set, the `S3` download strategy will download with a public (unsigned) URL. + * `HOMEBREW_BAT`: + If set, Homebrew will use `bat` for the `brew cat` command. + * `HOMEBREW_BOTTLE_DOMAIN`: By default, Homebrew uses `https://homebrew.bintray.com/` as its download mirror for bottles. If set, instructs Homebrew to instead use the specified diff --git a/docs/Manpage.md b/docs/Manpage.md index e813202421..15e0c8323a 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -1077,6 +1077,9 @@ Note that environment variables must have a value set to be detected. For exampl to retrieve these access credentials from AWS). If they are not set, the `S3` download strategy will download with a public (unsigned) URL. + * `HOMEBREW_BAT`: + If set, Homebrew will use `bat` for the `brew cat` command. + * `HOMEBREW_BOTTLE_DOMAIN`: By default, Homebrew uses `https://homebrew.bintray.com/` as its download mirror for bottles. If set, instructs Homebrew to instead use the specified diff --git a/manpages/brew.1 b/manpages/brew.1 index 65c6a12013..3f68e32c24 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BREW" "1" "September 2019" "Homebrew" "brew" +.TH "BREW" "1" "October 2019" "Homebrew" "brew" . .SH "NAME" \fBbrew\fR \- The missing package manager for macOS @@ -1336,6 +1336,10 @@ If set, Homebrew will only check for autoupdates once per this seconds interval\ When using the \fBS3\fR download strategy, Homebrew will look in these variables for access credentials (see \fIhttps://docs\.aws\.amazon\.com/cli/latest/userguide/cli\-chap\-getting\-started\.html#cli\-environment\fR to retrieve these access credentials from AWS)\. If they are not set, the \fBS3\fR download strategy will download with a public (unsigned) URL\. . .TP +\fBHOMEBREW_BAT\fR +If set, Homebrew will use \fBbat\fR for the \fBbrew cat\fR command\. +. +.TP \fBHOMEBREW_BOTTLE_DOMAIN\fR By default, Homebrew uses \fBhttps://homebrew\.bintray\.com/\fR as its download mirror for bottles\. If set, instructs Homebrew to instead use the specified URL\. For example, \fBHOMEBREW_BOTTLE_DOMAIN=http://localhost:8080\fR will cause all bottles to download from the prefix \fBhttp://localhost:8080/\fR\. .