use backticks around suggested input, flags, and binaries

This commit is contained in:
EricFromCanada 2021-01-24 21:40:41 -05:00
parent cd3cb6928b
commit 2ed324ebc0
23 changed files with 36 additions and 36 deletions

View File

@ -40,7 +40,7 @@ module Cask
def run_installer(command: nil, verbose: false, **_options)
ohai "Running installer for #{cask}; your password may be necessary.",
"Package installers may write to any location; options such as --appdir are ignored."
"Package installers may write to any location; options such as `--appdir` are ignored."
unless path.exist?
pkg = path.relative_path_from(cask.staged_path)
pkgs = Pathname.glob(cask.staged_path/"**"/"*.pkg").map { |path| path.relative_path_from(cask.staged_path) }

View File

@ -174,7 +174,7 @@ module Cask
[args.remaining.empty? ? NullCommand : UnknownSubcommand.new(args.remaining.first), argv]
if (replacement = DEPRECATED_COMMANDS[command])
odisabled "brew cask #{command.command_name}", replacement
odisabled "`brew cask #{command.command_name}`", replacement
end
if args.help?

View File

@ -482,7 +482,7 @@ module Cask
end
def zap
ohai %Q(Implied "brew uninstall --cask #{@cask}")
ohai "Implied `brew uninstall --cask #{@cask}`"
uninstall_artifacts
if (zap_stanzas = @cask.artifacts.select { |a| a.is_a?(Artifact::Zap) }).empty?
opoo "No zap stanza present for Cask '#{@cask}'"

View File

@ -32,7 +32,7 @@ module Cask
odebug "Checking quarantine support"
if !system_command(xattr, print_stderr: false).success?
odebug "There's not a working version of xattr."
odebug "There's no working version of `xattr` on this system."
:xattr_broken
elsif swift.nil?
odebug "Swift is not available on this system."

View File

@ -45,7 +45,7 @@ module Homebrew
when "all"
0
else
raise UsageError, "--prune= expects an integer or 'all'."
raise UsageError, "`--prune=` expects an integer or `all`."
end
end

View File

@ -146,7 +146,7 @@ module Homebrew
if args.ignore_dependencies?
opoo <<~EOS
#{Tty.bold}--ignore-dependencies is an unsupported Homebrew developer flag!#{Tty.reset}
#{Tty.bold}`--ignore-dependencies` is an unsupported Homebrew developer flag!#{Tty.reset}
Adjust your PATH to put any preferred versions of applications earlier in the
PATH rather than using this unsupported flag!

View File

@ -86,7 +86,7 @@ module Homebrew
end
if !args.force? && (formula.blank? || !formula.keg_only_reason.versioned_formula?)
opoo "#{keg.name} is keg-only and must be linked with --force"
opoo "#{keg.name} is keg-only and must be linked with `--force`."
puts_keg_only_path_message(keg)
next
end

View File

@ -28,9 +28,9 @@ module Homebrew
switch "--cask",
description: "List only outdated casks."
flag "--json",
description: "Print output in JSON format. There are two versions: v1 and v2. " \
"v1 is deprecated and is currently the default if no version is specified. " \
"v2 prints outdated formulae and casks. "
description: "Print output in JSON format. There are two versions: `v1` and `v2`. " \
"`v1` is deprecated and is currently the default if no version is specified. " \
"`v2` prints outdated formulae and casks. "
switch "--fetch-HEAD",
description: "Fetch the upstream repository to detect if the HEAD installation of the "\
"formula is outdated. Otherwise, the repository's HEAD will only be checked for "\
@ -50,7 +50,7 @@ module Homebrew
case (j = json_version(args.json))
when :v1
odisabled "brew outdated --json#{j == :v1 ? "=v1" : ""}", "brew outdated --json=v2"
odisabled "`brew outdated --json#{j == :v1 ? "=v1" : ""}`", "`brew outdated --json=v2`"
when :v2, :default
formulae, casks = if args.formula?
[outdated_formulae(args: args), []]

View File

@ -85,7 +85,7 @@ module Homebrew
puts Formatter.columns(Cask::Cask.to_a.map(&:full_name).sort)
else
odeprecated "'brew search' with no arguments to output formulae", "'brew formulae'"
odeprecated "`brew search` with no arguments to output formulae", "`brew formulae`"
puts Formatter.columns(Formula.full_names.sort)
end

View File

@ -400,7 +400,7 @@ module Homebrew
end
odie <<~EOS
--keep-old was passed but there are changes in:
`--keep-old` was passed but there are changes in:
#{mismatches.join("\n")}
EOS
end
@ -566,7 +566,7 @@ module Homebrew
def old_checksums(formula, formula_ast, bottle_hash, args:)
bottle_node = formula_ast.bottle_block
if bottle_node.nil?
odie "--keep-old was passed but there was no existing bottle block!" if args.keep_old?
odie "`--keep-old` was passed but there was no existing bottle block!" if args.keep_old?
return
end
return [] unless args.keep_old?
@ -576,7 +576,7 @@ module Homebrew
mismatches, checksums = merge_bottle_spec(old_keys, old_bottle_spec, bottle_hash["bottle"])
if mismatches.present?
odie <<~EOS
--keep-old was passed but there are changes in:
`--keep-old` was passed but there are changes in:
#{mismatches.join("\n")}
EOS
end

View File

@ -113,7 +113,7 @@ module Homebrew
if new_version.present?
if new_version.latest?
opoo "Ignoring specified --sha256= argument." if new_hash.present?
opoo "Ignoring specified `--sha256=` argument." if new_hash.present?
new_hash = :no_check
elsif new_hash.nil? || cask.languages.present?
tmp_contents = Utils::Inreplace.inreplace_pairs(cask.sourcefile_path,

View File

@ -196,7 +196,7 @@ module Homebrew
new_revision = Utils.popen_read("git -C \"#{resource_path}\" rev-parse -q --verify HEAD")
new_revision = new_revision.strip
elsif new_revision.blank?
odie "#{formula}: the current URL requires specifying a --revision= argument."
odie "#{formula}: the current URL requires specifying a `--revision=` argument."
end
false
elsif new_url.blank? && new_version.blank?
@ -424,11 +424,11 @@ module Homebrew
return if new_mirrors.present? || old_mirrors.empty?
if args.force?
opoo "#{formula}: Removing all mirrors because a --mirror= argument was not specified."
opoo "#{formula}: Removing all mirrors because a `--mirror=` argument was not specified."
else
odie <<~EOS
#{formula}: a --mirror= argument for updating the mirror URL(s) was not specified.
Use --force to remove all mirrors.
#{formula}: a `--mirror=` argument for updating the mirror URL(s) was not specified.
Use `--force` to remove all mirrors.
EOS
end
end
@ -439,7 +439,7 @@ module Homebrew
resource.owner = Resource.new(formula.name)
forced_version = new_version && new_version != resource.version
resource.version = new_version if forced_version
odie "No --version= argument specified!" if resource.version.blank?
odie "No `--version=` argument specified!" if resource.version.blank?
[resource.fetch, forced_version]
end

View File

@ -61,7 +61,7 @@ module Homebrew
require "keg"
require "cask"
ohai "Interactive Homebrew Shell", "Example commands available with: brew irb --examples"
ohai "Interactive Homebrew Shell", "Example commands available with: `brew irb --examples`"
if args.pry?
Pry.start
else

View File

@ -49,7 +49,7 @@ module Homebrew
_, user, repo, issue = *url_match
odie "Not a GitHub pull request: #{arg}" unless issue
if args.tap.present? && !"#{user}/#{repo}".casecmp(tap.full_name).zero?
odie "Pull request URL is for #{user}/#{repo} but --tap=#{tap.full_name}!"
odie "Pull request URL is for #{user}/#{repo} but `--tap=#{tap.full_name}` was specified!"
end
ohai "Dispatching #{tap} pull request ##{issue}"

View File

@ -414,7 +414,7 @@ module Homebrew
workflow_run.first.blank?
# Ignore that workflow as it was not executed and we specified
# that we could skip it.
ohai "Ignoring workflow #{workflow} as requested by --ignore-missing-artifacts"
ohai "Ignoring workflow #{workflow} as requested by `--ignore-missing-artifacts`"
next
end

View File

@ -129,7 +129,7 @@ module Homebrew
quiet_system "brew", "help"
# run brew update
oh1 "Running brew update..."
oh1 "Running `brew update`..."
safe_system "brew", "update", "--verbose", "--debug"
actual_end_commit = Utils.popen_read("git", "rev-parse", branch).chomp
if actual_end_commit != end_commit
@ -137,7 +137,7 @@ module Homebrew
end_log = Utils.popen_read("git", "log", "-1", "--decorate", "--oneline", end_commit).chomp
actual_log = Utils.popen_read("git", "log", "-1", "--decorate", "--oneline", actual_end_commit).chomp
odie <<~EOS
brew update didn't update #{branch}!
`brew update` didn't update #{branch}!
Start commit: #{start_log}
Expected end commit: #{end_log}
Actual end commit: #{actual_log}

View File

@ -983,7 +983,7 @@ module Homebrew
EOS
end
elsif result.stderr.include? "pkg_resources.DistributionNotFound"
"Your Python installation is unable to find xattr."
"Your Python installation is unable to find `xattr`."
else
"unknown xattr error: #{result.stderr.split("\n").last}"
end
@ -994,7 +994,7 @@ module Homebrew
when :quarantine_available
nil
when :xattr_broken
"There's not a working version of xattr."
"There's no working version of `xattr` on this system."
when :no_swift
"Swift is not available on this system."
when :no_quarantine

View File

@ -241,7 +241,7 @@ module Homebrew
HOMEBREW_NO_INSTALL_CLEANUP: {
description: "If set, `brew install`, `brew upgrade` and `brew reinstall` will never automatically " \
"cleanup installed/upgraded/reinstalled formulae or all formulae every " \
"HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS days.",
"`HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS` days.",
boolean: true,
},
HOMEBREW_PRY: {

View File

@ -31,7 +31,7 @@ module FormulaCellarChecks
<<~EOS
A top-level "man" directory was found
Homebrew requires that man pages live under share.
This can often be fixed by passing "--mandir=\#{man}" to configure.
This can often be fixed by passing `--mandir=\#{man}` to `configure`.
EOS
end
@ -42,7 +42,7 @@ module FormulaCellarChecks
<<~EOS
A top-level "info" directory was found
Homebrew suggests that info pages live under share.
This can often be fixed by passing "--infodir=\#{info}" to configure.
This can often be fixed by passing `--infodir=\#{info}` to `configure`.
EOS
end

View File

@ -225,10 +225,10 @@ module Formulary
def load_file(flags:)
if %r{githubusercontent.com/[\w-]+/[\w-]+/[a-f0-9]{40}(?:/Formula)?/(?<formula_name>[\w+-.@]+).rb} =~ url # rubocop:disable Style/CaseLikeIf
raise UsageError, "Installation of #{formula_name} from a GitHub commit URL is unsupported! " \
"'brew extract #{formula_name}' to stable tap on GitHub instead."
"`brew extract #{formula_name}` to a stable tap on GitHub instead."
elsif url.match?(%r{^(https?|ftp)://})
raise UsageError, "Non-checksummed download of #{name} formula file from an arbitrary URL is unsupported! ",
"'brew extract' or 'brew create' and 'brew tap-new' to create a "\
"`brew extract` or `brew create` and `brew tap-new` to create a "\
"formula file in a tap on GitHub instead."
end
HOMEBREW_CACHE_FORMULA.mkpath

View File

@ -160,7 +160,7 @@ module ELFShim
def save_using_patchelf(new_interpreter, new_rpath)
patchelf = DevelopmentTools.locate "patchelf"
odie "Could not locate patchelf, please: brew install patchelf." if patchelf.blank?
odie "Could not locate `patchelf`; please run `brew install patchelf`" if patchelf.blank?
args = []
args << "--set-interpreter" << new_interpreter if new_interpreter.present?
args << "--force-rpath" << "--set-rpath" << new_rpath if new_rpath.present?

View File

@ -411,7 +411,7 @@ describe "brew bottle --merge", :integration_test, :needs_linux do
"--keep-old",
"#{TEST_TMPDIR}/testball-1.0.big_sur.bottle.json",
"#{TEST_TMPDIR}/testball-1.0.catalina.bottle.json"
}.to output("Error: --keep-old was passed but there was no existing bottle block!\n").to_stderr
}.to output("Error: `--keep-old` was passed but there was no existing bottle block!\n").to_stderr
end
it "updates the bottle block in a formula that already has a bottle block when using --keep-old" do

View File

@ -16,7 +16,7 @@ module Utils
which("curl"),
"/usr/bin/curl",
].compact.map { |c| Pathname(c) }.find(&:executable?)
raise "No executable curl was found" unless @curl
raise "No executable `curl` was found" unless @curl
@curl
end