mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
dev-cmd/: edit help text and descriptions.
This commit is contained in:
parent
4a0e97d85a
commit
ddf057f3dd
@ -1,6 +1,7 @@
|
||||
#: * `audit` [`--strict`] [`--fix`] [`--online`] [`--new-formula`] [`--display-cop-names`] [`--display-filename`] [`--only=`<method>|`--except=`<method>] [`--only-cops=`<cops>|`--except-cops=`<cops>] [<formulae>]:
|
||||
#: Check <formulae> for Homebrew coding style violations. This should be
|
||||
#: run before submitting a new formula.
|
||||
#: Check <formulae> for Homebrew coding style violations. This should be run
|
||||
#: before submitting a new formula. Will exit with a non-zero status if any errors
|
||||
#: are found, which can be useful for implementing pre-commit hooks.
|
||||
#:
|
||||
#: If no <formulae> are provided, all of them are checked.
|
||||
#:
|
||||
@ -23,16 +24,13 @@
|
||||
#: If `--display-filename` is passed, every line of output is prefixed with the
|
||||
#: name of the file or formula being audited, to make the output easy to grep.
|
||||
#:
|
||||
#: Passing `--only=`<method> will run only the methods named `audit_<method>`,
|
||||
#: while `--except=`<method> will skip the methods named `audit_<method>`.
|
||||
#: Specifying `--only=`<method> will run only the methods named `audit_`<method>,
|
||||
#: while `--except=`<method> will skip the methods named `audit_`<method>.
|
||||
#: For either option <method> should be a comma-separated list.
|
||||
#:
|
||||
#: Passing `--only-cops=`<cops> will check for violations of only the listed
|
||||
#: Specifying `--only-cops=`<cops> will check for violations of only the listed
|
||||
#: RuboCop <cops>, while `--except-cops=`<cops> will skip checking the listed
|
||||
#: <cops>. For either option <cops> should be a comma-separated list of cop names.
|
||||
#:
|
||||
#: `audit` exits with a non-zero status if any errors are found. This is useful,
|
||||
#: for instance, for implementing pre-commit hooks.
|
||||
|
||||
# Undocumented options:
|
||||
# `-D` activates debugging and profiling of the audit methods (not the same as `--debug`)
|
||||
@ -57,12 +55,13 @@ module Homebrew
|
||||
usage_banner <<~EOS
|
||||
`audit` [<options>] <formulae>:
|
||||
|
||||
Check <formulae> for Homebrew coding style violations. This should be
|
||||
run before submitting a new formula.
|
||||
Check <formulae> for Homebrew coding style violations. This should be run before
|
||||
submitting a new formula. Will exit with a non-zero status if any errors are
|
||||
found, which can be useful for implementing pre-commit hooks.
|
||||
If no <formulae> are provided, all of them are checked.
|
||||
EOS
|
||||
switch "--strict",
|
||||
description: "Run additional style checks, including Rubocop style checks."
|
||||
description: "Run additional style checks, including RuboCop style checks."
|
||||
switch "--online",
|
||||
description: "Run additional slower style checks that require a network connection."
|
||||
switch "--new-formula",
|
||||
@ -77,21 +76,23 @@ module Homebrew
|
||||
description: "Prefix every line of output with name of the file or formula being audited, to "\
|
||||
"make output easy to grep."
|
||||
switch "-D", "--audit-debug",
|
||||
description: "Activates debugging and profiling"
|
||||
description: "Enable debugging and profiling of audit methods."
|
||||
comma_array "--only",
|
||||
description: "Passing `--only=`<method> will run only the methods named audit_<method>. "\
|
||||
"<method> should be a comma-separated list."
|
||||
description: "Specify a comma-separated <method> list to only run the methods named "\
|
||||
"`audit_`<method>."
|
||||
comma_array "--except",
|
||||
description: "Passing `--except=`<method> will run only the methods named audit_<method>, "\
|
||||
"<method> should be a comma-separated list."
|
||||
description: "Specify a comma-separated <method> list to skip running the methods named "\
|
||||
"`audit_`<method>."
|
||||
comma_array "--only-cops",
|
||||
description: "Passing `--only-cops=`<cops> will check for violations of only the listed "\
|
||||
"RuboCop cops. <cops> should be a comma-separated list of cop names."
|
||||
description: "Specify a comma-separated <cops> list to check for violations of only the listed "\
|
||||
"RuboCop cops."
|
||||
comma_array "--except-cops",
|
||||
description: "Passing `--except-cops=`<cops> will skip checking the listed RuboCop cops "\
|
||||
"violations. <cops> should be a comma-separated list of cop names."
|
||||
description: "Specify a comma-separated <cops> list to skip checking for violations of the listed "\
|
||||
"RuboCop cops."
|
||||
switch :verbose
|
||||
switch :debug
|
||||
conflicts "--only", "--except"
|
||||
conflicts "--only-cops", "--except-cops"
|
||||
end
|
||||
end
|
||||
|
||||
@ -126,7 +127,7 @@ module Homebrew
|
||||
if only_cops && except_cops
|
||||
odie "--only-cops and --except-cops cannot be used simultaneously!"
|
||||
elsif (only_cops || except_cops) && (strict || args.only)
|
||||
odie "--only-cops/--except-cops and --strict/--only cannot be used simultaneously"
|
||||
odie "--only-cops/--except-cops and --strict/--only cannot be used simultaneously!"
|
||||
end
|
||||
|
||||
options = { fix: args.fix?, realpath: true }
|
||||
|
@ -1,10 +1,10 @@
|
||||
#: * `bottle` [`--verbose`] [`--no-rebuild`|`--keep-old`] [`--skip-relocation`] [`--or-later`] [`--root-url=`<URL>] [`--force-core-tap`] [`--json`] <formulae>:
|
||||
#: Generate a bottle (binary package) from a formula installed with
|
||||
#: Generate a bottle (binary package) from a formula that was installed with
|
||||
#: `--build-bottle`.
|
||||
#:
|
||||
#: If the formula specifies a rebuild version, it will be incremented in the
|
||||
#: generated DSL. Passing `--keep-old` will attempt to keep it at its
|
||||
#: original value, while `--no-rebuild` will remove it.
|
||||
#: generated DSL. Passing `--keep-old` will attempt to keep it at its original
|
||||
#: value, while `--no-rebuild` will remove it.
|
||||
#:
|
||||
#: If `--verbose` (or `-v`) is passed, print the bottling commands and any warnings
|
||||
#: encountered.
|
||||
@ -15,7 +15,7 @@
|
||||
#: If `--root-url` is passed, use the specified <URL> as the root of the
|
||||
#: bottle's URL instead of Homebrew's default.
|
||||
#:
|
||||
#: If `--or-later` is passed, append _or_later to the bottle tag.
|
||||
#: If `--or-later` is passed, append `_or_later` to the bottle tag.
|
||||
#:
|
||||
#: If `--force-core-tap` is passed, build a bottle even if <formula> is not
|
||||
#: in homebrew/core or any installed taps.
|
||||
@ -74,11 +74,11 @@ module Homebrew
|
||||
usage_banner <<~EOS
|
||||
`bottle` [<options>] <formulae>:
|
||||
|
||||
Generate a bottle (binary package) from a formula installed with
|
||||
Generate a bottle (binary package) from a formula that was installed with
|
||||
`--build-bottle`.
|
||||
If the formula specifies a rebuild version, it will be incremented in the
|
||||
generated DSL. Passing `--keep-old` will attempt to keep it at its
|
||||
original value, while `--no-rebuild` will remove it.
|
||||
generated DSL. Passing `--keep-old` will attempt to keep it at its original
|
||||
value, while `--no-rebuild` will remove it.
|
||||
EOS
|
||||
switch "--skip-relocation",
|
||||
description: "Do not check if the bottle can be marked as relocatable."
|
||||
@ -87,28 +87,30 @@ module Homebrew
|
||||
switch "--force-core-tap",
|
||||
description: "Build a bottle even if <formula> is not in homebrew/core or any installed taps."
|
||||
switch "--no-rebuild",
|
||||
description: "If the formula specifies a rebuild version, it will be removed in the generated DSL."
|
||||
description: "If the formula specifies a rebuild version, remove it from the generated DSL."
|
||||
switch "--keep-old",
|
||||
description: "If the formula specifies a rebuild version, it will attempted to be kept in the "\
|
||||
description: "If the formula specifies a rebuild version, attempt to preserve its value in the "\
|
||||
"generated DSL."
|
||||
switch "--merge",
|
||||
description: "Generate a bottle from a formula and print the new DSL merged into the "\
|
||||
"existing formula."
|
||||
switch "--write",
|
||||
description: "Changes will be written to the formula file. A new commit will be generated unless "\
|
||||
"`--no-commit` is passed."
|
||||
switch "--no-commit",
|
||||
description: "When passed with `--write`, a new commit will not generated while writing changes "\
|
||||
"to the formula file.",
|
||||
depends_on: "--write"
|
||||
switch "--json",
|
||||
description: "Write bottle information to a JSON file, which can be used as the argument for "\
|
||||
"`--merge`."
|
||||
switch "--merge",
|
||||
description: "Generate an updated bottle block for a formula and optionally merge it into the "\
|
||||
"formula file. Instead of a formula name, requires a JSON file generated with "\
|
||||
"`brew bottle --json` <formula>."
|
||||
switch "--write",
|
||||
depends_on: "--merge",
|
||||
description: "Write the changes to the formula file. A new commit will be generated unless "\
|
||||
"`--no-commit` is passed."
|
||||
switch "--no-commit",
|
||||
depends_on: "--write",
|
||||
description: "When passed with `--write`, a new commit will not generated after writing changes "\
|
||||
"to the formula file."
|
||||
flag "--root-url",
|
||||
description: "Use the specified <URL> as the root of the bottle's URL instead of Homebrew's "\
|
||||
"default."
|
||||
description: "Use the specified <URL> as the root of the bottle's URL instead of Homebrew's default."
|
||||
switch :verbose
|
||||
switch :debug
|
||||
conflicts "--no-rebuild", "--keep-old"
|
||||
end
|
||||
end
|
||||
|
||||
@ -228,7 +230,7 @@ module Homebrew
|
||||
|
||||
unless tap = f.tap
|
||||
unless args.force_core_tap?
|
||||
return ofail "Formula not from core or any taps: #{f.full_name}"
|
||||
return ofail "Formula not from core or any installed taps: #{f.full_name}"
|
||||
end
|
||||
|
||||
tap = CoreTap.instance
|
||||
|
@ -1,11 +1,11 @@
|
||||
#: * `bump-formula-pr` [`--devel`] [`--dry-run` [`--write`]] [`--audit`|`--strict`] [`--mirror=`<URL>] [`--version=`<version>] [`--message=`<message>] (`--url=`<URL> `--sha256=`<sha-256>|`--tag=`<tag> `--revision=`<revision>) <formula>:
|
||||
#: Creates a pull request to update the formula with a new URL or a new tag.
|
||||
#: * `bump-formula-pr` [`--devel`] [`--dry-run` [`--write`]] [`--audit`|`--strict`] [`--no-browse] [`--mirror=`<URL>] [`--version=`<version>] [`--message=`<message>] (`--url=`<URL> `--sha256=`<SHA-256>|`--tag=`<tag> `--revision=`<revision>) [<formula>]:
|
||||
#: Create a pull request to update a formula with a new URL or a new tag.
|
||||
#:
|
||||
#: If a <URL> is specified, the <sha-256> checksum of the new download must
|
||||
#: also be specified. A best effort to determine the <sha-256> and <formula>
|
||||
#: If a <URL> is specified, the <SHA-256> checksum of the new download should
|
||||
#: also be specified. A best effort to determine the <SHA-256> and <formula>
|
||||
#: name will be made if either or both values are not supplied by the user.
|
||||
#:
|
||||
#: If a <tag> is specified, the git commit <revision> corresponding to that
|
||||
#: If a <tag> is specified, the Git commit <revision> corresponding to that
|
||||
#: tag must also be specified.
|
||||
#:
|
||||
#: If `--devel` is passed, bump the development rather than stable version.
|
||||
@ -13,8 +13,8 @@
|
||||
#:
|
||||
#: If `--dry-run` is passed, print what would be done rather than doing it.
|
||||
#:
|
||||
#: If `--write` is passed along with `--dry-run`, perform a not-so-dry run
|
||||
#: making the expected file modifications but not taking any git actions.
|
||||
#: If `--write` is passed along with `--dry-run`, perform a not-so-dry run by
|
||||
#: making the expected file modifications but not taking any Git actions.
|
||||
#:
|
||||
#: If `--audit` is passed, run `brew audit` before opening the PR.
|
||||
#:
|
||||
@ -24,7 +24,7 @@
|
||||
#:
|
||||
#: If `--version=`<version> is passed, use the value to override the value
|
||||
#: parsed from the URL or tag. Note that `--version=0` can be used to delete
|
||||
#: an existing `version` override from a formula if it has become redundant.
|
||||
#: an existing version override from a formula if it has become redundant.
|
||||
#:
|
||||
#: If `--message=`<message> is passed, append <message> to the default PR
|
||||
#: message.
|
||||
@ -36,8 +36,8 @@
|
||||
#: If `--quiet` is passed, don't output replacement messages or warn about
|
||||
#: duplicate pull requests.
|
||||
#:
|
||||
#: Note that this command cannot be used to transition a formula from a
|
||||
#: URL-and-sha256 style specification into a tag-and-revision style
|
||||
#: *Note:* this command cannot be used to transition a formula from a
|
||||
#: URL-and-SHA-256 style specification into a tag-and-revision style
|
||||
#: specification, nor vice versa. It must use whichever style specification
|
||||
#: the preexisting formula already uses.
|
||||
|
||||
@ -50,57 +50,58 @@ module Homebrew
|
||||
def bump_formula_pr_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`bump-formula-pr` [<options>] <formula>:
|
||||
`bump-formula-pr` [<options>] [<formula>]:
|
||||
|
||||
Creates a pull request to update the formula with a new URL or a new tag.
|
||||
Create a pull request to update a formula with a new URL or a new tag.
|
||||
|
||||
If a <URL> is specified, the <sha-256> checksum of the new download must
|
||||
also be specified. A best effort to determine the <sha-256> and <formula>
|
||||
name will be made if either or both values are not supplied by the user.
|
||||
If a <URL> is specified, the <SHA-256> checksum of the new download should also
|
||||
be specified. A best effort to determine the <SHA-256> and <formula> name will
|
||||
be made if either or both values are not supplied by the user.
|
||||
|
||||
If a <tag> is specified, the git commit <revision> corresponding to that
|
||||
tag must also be specified.
|
||||
If a <tag> is specified, the Git commit <revision> corresponding to that tag
|
||||
must also be specified.
|
||||
|
||||
Note that this command cannot be used to transition a formula from a
|
||||
URL-and-sha256 style specification into a tag-and-revision style
|
||||
specification, nor vice versa. It must use whichever style specification
|
||||
the preexisting formula already uses.
|
||||
*Note:* this command cannot be used to transition a formula from a
|
||||
URL-and-SHA-256 style specification into a tag-and-revision style specification,
|
||||
nor vice versa. It must use whichever style specification the preexisting
|
||||
formula already uses.
|
||||
EOS
|
||||
switch "--devel",
|
||||
description: "Bump the development rather than stable version. The development spec must already exist."
|
||||
switch "-n", "--dry-run",
|
||||
description: "Print what would be done rather than doing it."
|
||||
switch "--write",
|
||||
description: "When passed along with `--dry-run`, perform a not-so-dry run making the expected "\
|
||||
"file modifications but not taking any git actions."
|
||||
depends_on: "--dry-run",
|
||||
description: "When passed along with `--dry-run`, perform a not-so-dry run by making the expected "\
|
||||
"file modifications but not taking any Git actions."
|
||||
switch "--audit",
|
||||
description: "Run `brew audit` before opening the PR."
|
||||
switch "--strict",
|
||||
description: "Run `brew audit --strict` before opening the PR."
|
||||
switch "--no-browse",
|
||||
description: "Output the pull request URL instead of opening in a browser"
|
||||
flag "--url=",
|
||||
description: "Provide new <URL> for the formula. If a <URL> is specified, the <sha-256> "\
|
||||
"checksum of the new download must also be specified."
|
||||
flag "--revision=",
|
||||
description: "Specify the new git commit <revision> corresponding to a specified <tag>."
|
||||
flag "--tag=",
|
||||
required_for: "--revision=",
|
||||
description: "Specify the new git commit <tag> for the formula."
|
||||
flag "--sha256=",
|
||||
depends_on: "--url=",
|
||||
description: "Specify the <sha-256> checksum of new download."
|
||||
description: "Print the pull request URL instead of opening in a browser."
|
||||
flag "--mirror=",
|
||||
description: "Use the provided <URL> as a mirror URL."
|
||||
flag "--version=",
|
||||
description: "Use the provided <version> to override the value parsed from the URL or tag. Note "\
|
||||
"that `--version=0` can be used to delete an existing `version` override from a "\
|
||||
"that `--version=0` can be used to delete an existing version override from a "\
|
||||
"formula if it has become redundant."
|
||||
flag "--message=",
|
||||
description: "Append provided <message> to the default PR message."
|
||||
description: "Append the provided <message> to the default PR message."
|
||||
flag "--url=",
|
||||
description: "Specify the <URL> for the new download. If a <URL> is specified, the <SHA-256> "\
|
||||
"checksum of the new download should also be specified."
|
||||
flag "--sha256=",
|
||||
depends_on: "--url=",
|
||||
description: "Specify the <SHA-256> checksum of the new download."
|
||||
flag "--tag=",
|
||||
description: "Specify the new git commit <tag> for the formula."
|
||||
flag "--revision=",
|
||||
required_for: "--tag=",
|
||||
description: "Specify the new git commit <revision> corresponding to a specified <tag>."
|
||||
|
||||
switch :quiet
|
||||
switch :force
|
||||
switch :quiet
|
||||
switch :verbose
|
||||
switch :debug
|
||||
conflicts "--url", "--tag"
|
||||
@ -352,7 +353,7 @@ module Homebrew
|
||||
"#{new_formula_version}#{devel_message}' -- #{formula.path}"
|
||||
ohai "git push --set-upstream $HUB_REMOTE #{branch}:#{branch}"
|
||||
ohai "create pull request with GitHub API"
|
||||
ohai "git checkout -"
|
||||
ohai "git checkout --quiet -"
|
||||
else
|
||||
|
||||
begin
|
||||
|
@ -1,17 +1,17 @@
|
||||
#: * `create` <URL> [`--autotools`|`--cmake`|`--meson`] [`--no-fetch`] [`--set-name` <name>] [`--set-version` <version>] [`--tap` <user>`/`<repo>]:
|
||||
#: * `create` [`--autotools`|`--cmake`|`--meson`] [`--no-fetch`] [`--set-name` <name>] [`--set-version` <version>] [`--tap` <user>`/`<repo>] <URL>:
|
||||
#: Generate a formula for the downloadable file at <URL> and open it in the editor.
|
||||
#: Homebrew will attempt to automatically derive the formula name
|
||||
#: and version, but if it fails, you'll have to make your own template. The `wget`
|
||||
#: formula serves as a simple example. For the complete API have a look at
|
||||
#: <https://www.rubydoc.info/github/Homebrew/brew/master/Formula>.
|
||||
#: formula serves as a simple example. For the complete API, see:
|
||||
#: <https://www.rubydoc.info/github/Homebrew/brew/master/Formula>
|
||||
#:
|
||||
#: If `--autotools` is passed, create a basic template for an Autotools-style build.
|
||||
#: If `--cmake` is passed, create a basic template for a CMake-style build.
|
||||
#: If `--meson` is passed, create a basic template for a Meson-style build.
|
||||
#:
|
||||
#: If `--no-fetch` is passed, Homebrew will not download <URL> to the cache and
|
||||
#: will thus not add the SHA256 to the formula for you. It will also not check
|
||||
#: the GitHub API for GitHub projects (to fill out the description and homepage).
|
||||
#: will thus not add the SHA-256 to the formula for you, nor will it check
|
||||
#: the GitHub API for GitHub projects (to fill out its description and homepage).
|
||||
#:
|
||||
#: The options `--set-name` and `--set-version` each take an argument and allow
|
||||
#: you to explicitly set the name and version of the package you are creating.
|
||||
@ -30,13 +30,13 @@ module Homebrew
|
||||
def create_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`create` <URL> [<options>]:
|
||||
`create` [<options>] <URL>:
|
||||
|
||||
Generate a formula for the downloadable file at <URL> and open it in the editor.
|
||||
Homebrew will attempt to automatically derive the formula name
|
||||
and version, but if it fails, you'll have to make your own template. The `wget`
|
||||
formula serves as a simple example. For the complete API have a look at
|
||||
<http://www.rubydoc.info/github/Homebrew/brew/master/Formula>.
|
||||
Homebrew will attempt to automatically derive the formula name and version, but
|
||||
if it fails, you'll have to make your own template. The `wget` formula serves as
|
||||
a simple example. For the complete API, see:
|
||||
<http://www.rubydoc.info/github/Homebrew/brew/master/Formula>
|
||||
EOS
|
||||
switch "--autotools",
|
||||
description: "Create a basic template for an Autotools-style build."
|
||||
@ -45,17 +45,17 @@ module Homebrew
|
||||
switch "--meson",
|
||||
description: "Create a basic template for a Meson-style build."
|
||||
switch "--no-fetch",
|
||||
description: "Homebrew will not download <URL> to the cache and will thus not add the SHA256 to "\
|
||||
"the formula for you. It will also not check the GitHub API for GitHub projects "\
|
||||
"(to fill out the description and homepage)."
|
||||
switch "--HEAD"
|
||||
description: "Homebrew will not download <URL> to the cache and will thus not add the SHA-256 "\
|
||||
"to the formula for you, nor will it check the GitHub API for GitHub projects "\
|
||||
"(to fill out its description and homepage)."
|
||||
switch "--HEAD",
|
||||
description: "Indicate that <URL> points to the package's repository rather than a file."
|
||||
flag "--set-name=",
|
||||
description: "Set the provided name of the package you are creating."
|
||||
description: "Set the name of the new formula to the provided <name>."
|
||||
flag "--set-version=",
|
||||
description: "Set the provided version of the package you are creating."
|
||||
description: "Set the version of the new formula to the provided <version>."
|
||||
flag "--tap=",
|
||||
description: "Takes a tap [<user>`/`<repo>] as argument and generates the formula in the "\
|
||||
"specified tap."
|
||||
description: "Generate the new formula in the provided tap, specified as <user>`/`<repo>."
|
||||
switch :force
|
||||
switch :verbose
|
||||
switch :debug
|
||||
|
@ -1,8 +1,8 @@
|
||||
#: * `edit`:
|
||||
#: Open all of Homebrew for editing.
|
||||
#: Open the Homebrew repository for editing.
|
||||
#:
|
||||
#: * `edit` <formula>:
|
||||
#: Open <formula> in the editor.
|
||||
#: Open <formula> in the editor set by `EDITOR` or `HOMEBREW_EDITOR`.
|
||||
|
||||
require "formula"
|
||||
require "cli_parser"
|
||||
@ -13,9 +13,10 @@ module Homebrew
|
||||
def edit_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`edit` <formula>:
|
||||
Open <formula> in the editor. Open all of Homebrew for editing if
|
||||
no <formula> is provided.
|
||||
`edit` [<formulae>]:
|
||||
|
||||
Open a formula in the editor set by `EDITOR` or `HOMEBREW_EDITOR`, or open the
|
||||
Homebrew repository for editing if no <formula> is provided.
|
||||
EOS
|
||||
switch :force
|
||||
switch :verbose
|
||||
@ -29,7 +30,7 @@ module Homebrew
|
||||
unless (HOMEBREW_REPOSITORY/".git").directory?
|
||||
raise <<~EOS
|
||||
Changes will be lost!
|
||||
The first time you `brew update', all local changes will be lost, you should
|
||||
The first time you `brew update', all local changes will be lost; you should
|
||||
thus `brew update' before you `brew edit'!
|
||||
EOS
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
#: * `extract` [`--force`] <formula> <tap> [`--version=`<version>]:
|
||||
#: Looks through repository history to find the <version> of <formula> and
|
||||
#: creates a copy in <tap>/Formula/<formula>@<version>.rb. If the tap is
|
||||
#: not installed yet, attempts to install/clone the tap before continuing.
|
||||
#: Look through repository history to find the most recent version of <formula> and
|
||||
#: create a copy in <tap>`/Formula/`<formula>`@`<version>`.rb`. If the tap is
|
||||
#: not installed yet, attempt to install/clone the tap before continuing.
|
||||
#:
|
||||
#: If `--force` is passed, the file at the destination will be overwritten
|
||||
#: if it already exists. Otherwise, existing files will be preserved.
|
||||
@ -101,16 +101,15 @@ module Homebrew
|
||||
usage_banner <<~EOS
|
||||
`extract` [<options>] <formula> <tap>:
|
||||
|
||||
Looks through repository history to find the <version> of <formula> and
|
||||
creates a copy in <tap>/Formula/<formula>@<version>.rb. If the tap is
|
||||
not installed yet, attempts to install/clone the tap before continuing.
|
||||
Look through repository history to find the most recent version of <formula> and
|
||||
create a copy in <tap>`/Formula/`<formula>`@`<version>`.rb`. If the tap is not
|
||||
installed yet, attempt to install/clone the tap before continuing.
|
||||
EOS
|
||||
|
||||
flag "--version=",
|
||||
description: "Provided <version> of <formula> will be extracted and placed in the destination "\
|
||||
"tap. Otherwise, the most recent version that can be found will be used."
|
||||
switch :debug
|
||||
description: "Extract the provided <version> of <formula> instead of the most recent."
|
||||
switch :force
|
||||
switch :debug
|
||||
end
|
||||
end
|
||||
|
||||
@ -128,7 +127,7 @@ module Homebrew
|
||||
repo = CoreTap.instance.path
|
||||
# Formulae can technically live in "<repo>/<formula>.rb" or
|
||||
# "<repo>/Formula/<formula>.rb", but explicitly use the latter for now
|
||||
# since that is now core tap is structured.
|
||||
# since that is how the core tap is structured.
|
||||
file = repo/"Formula/#{name}.rb"
|
||||
|
||||
if args.version
|
||||
@ -175,7 +174,7 @@ module Homebrew
|
||||
odie <<~EOS
|
||||
Destination formula already exists: #{path}
|
||||
To overwrite it and continue anyways, run:
|
||||
`brew extract #{name} --version=#{version} --tap=#{destination_tap.name} --force`
|
||||
brew extract --force --version=#{version} #{name} #{destination_tap.name}
|
||||
EOS
|
||||
end
|
||||
ohai "Overwriting existing formula at #{path}" if ARGV.debug?
|
||||
|
@ -1,5 +1,5 @@
|
||||
#: * `formula` <formula>:
|
||||
#: Display the path where <formula> is located.
|
||||
#: * `formula` <formulae>:
|
||||
#: Display the path where a formula is located.
|
||||
|
||||
require "formula"
|
||||
require "cli_parser"
|
||||
@ -10,12 +10,12 @@ module Homebrew
|
||||
def formula_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`formula` <formula>:
|
||||
`formula` <formulae>:
|
||||
|
||||
Display the path where <formula> is located.
|
||||
Display the path where a formula is located.
|
||||
EOS
|
||||
switch :debug
|
||||
switch :verbose
|
||||
switch :debug
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -2,8 +2,9 @@
|
||||
#: Enter the interactive Homebrew Ruby shell.
|
||||
#:
|
||||
#: If `--examples` is passed, several examples will be shown.
|
||||
#: If `--pry` is passed or HOMEBREW_PRY is set, pry will be
|
||||
#: used instead of irb.
|
||||
#:
|
||||
#: If `--pry` is passed or `HOMEBREW_PRY` is set, Pry will be
|
||||
#: used instead of IRB.
|
||||
|
||||
require "cli_parser"
|
||||
|
||||
@ -33,7 +34,7 @@ module Homebrew
|
||||
description: "Show several examples."
|
||||
switch "--pry",
|
||||
env: :pry,
|
||||
description: "Pry will be used instead of irb if `--pry` is passed or HOMEBREW_PRY is set."
|
||||
description: "Use Pry instead of IRB. Implied if `HOMEBREW_PRY` is set."
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1,14 +1,12 @@
|
||||
#: * `linkage` [`--test`] [`--reverse`] [<formulae>]:
|
||||
#: Checks the library links of installed formulae.
|
||||
#:
|
||||
#: Only works on installed formulae. An error is raised if it is run on
|
||||
#: uninstalled formulae.
|
||||
#: Check the library links for kegs of installed formulae.
|
||||
#: Raises an error if run on uninstalled formulae.
|
||||
#:
|
||||
#: If `--test` is passed, only display missing libraries and exit with a
|
||||
#: non-zero exit code if any missing libraries were found.
|
||||
#: non-zero status if any missing libraries are found.
|
||||
#:
|
||||
#: If `--reverse` is passed, print the dylib followed by the binaries
|
||||
#: which link to it for each library the keg references.
|
||||
#: If `--reverse` is passed, for every library that a keg references,
|
||||
#: print its dylib path followed by the binaries that link to it.
|
||||
#:
|
||||
#: If <formulae> are given, check linkage for only the specified brews.
|
||||
|
||||
@ -22,21 +20,19 @@ module Homebrew
|
||||
def linkage_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`linkage` [<options>] <formula>:
|
||||
`linkage` [<options>] [<formulae>]:
|
||||
|
||||
Checks the library links of an installed formula.
|
||||
|
||||
Only works on installed formulae. An error is raised if it is run on
|
||||
uninstalled formulae.
|
||||
Check the library links for kegs of installed formulae.
|
||||
Raises an error if run on uninstalled formulae.
|
||||
EOS
|
||||
switch "--test",
|
||||
description: "Display only missing libraries and exit with a non-zero exit code if any missing "\
|
||||
"libraries were found."
|
||||
description: "Display only missing libraries and exit with a non-zero status if any missing "\
|
||||
"libraries are found."
|
||||
switch "--reverse",
|
||||
description: "Print the dylib followed by the binaries which link to it for each library the keg "\
|
||||
"references."
|
||||
description: "For every library that a keg references, print its dylib path followed by the "\
|
||||
"binaries that link to it."
|
||||
switch "--cached",
|
||||
description: "Print the cached linkage values stored in HOMEBREW_CACHE, set from a previous "\
|
||||
description: "Print the cached linkage values stored in `HOMEBREW_CACHE`, set by a previous "\
|
||||
"`brew linkage` run."
|
||||
switch :verbose
|
||||
switch :debug
|
||||
|
@ -47,7 +47,7 @@ module Homebrew
|
||||
"the date used in new manpages will match those in the existing manpages (to allow "\
|
||||
"comparison without factoring in the date)."
|
||||
switch "--link",
|
||||
description: "It is now done automatically by `brew update`."
|
||||
description: "This is now done automatically by `brew update`."
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -14,15 +14,15 @@ module Homebrew
|
||||
|
||||
Reuploads the stable URL for a formula to Bintray to use it as a mirror.
|
||||
EOS
|
||||
switch :debug
|
||||
switch :verbose
|
||||
switch :debug
|
||||
end
|
||||
end
|
||||
|
||||
def mirror
|
||||
mirror_args.parse
|
||||
|
||||
odie "This command requires at least formula argument!" if ARGV.named.empty?
|
||||
odie "This command requires at least one formula argument!" if ARGV.named.empty?
|
||||
|
||||
bintray_user = ENV["HOMEBREW_BINTRAY_USER"]
|
||||
bintray_key = ENV["HOMEBREW_BINTRAY_KEY"]
|
||||
|
@ -1,6 +1,6 @@
|
||||
#: * `pull` [`--bottle`] [`--bump`] [`--clean`] [`--ignore-whitespace`] [`--resolve`] [`--branch-okay`] [`--no-pbcopy`] [`--no-publish`] [`--warn-on-publish-failure`] [`--bintray-org=`<bintray-org>] [`--test-bot-user=`<test-bot-user>] <patch-source> [<patch-source>]:
|
||||
#: Gets a patch from a GitHub commit or pull request and applies it to Homebrew.
|
||||
#: Optionally, installs the formulae changed by the patch.
|
||||
#: Get a patch from a GitHub commit or pull request and apply it to Homebrew.
|
||||
#: Optionally, publish updated bottles for the formulae changed by the patch.
|
||||
#:
|
||||
#: Each <patch-source> may be one of:
|
||||
#:
|
||||
@ -41,11 +41,11 @@
|
||||
#: If `--warn-on-publish-failure` was passed, do not exit if there's a
|
||||
#: failure publishing bottles on Bintray.
|
||||
#:
|
||||
#: If `--bintray-org=`<bintray-org> is passed, publish at the given Bintray
|
||||
#: If `--bintray-org=`<bintray-org> is passed, publish at the provided Bintray
|
||||
#: organisation.
|
||||
#:
|
||||
#: If `--test-bot-user=`<test-bot-user> is passed, pull the bottle block
|
||||
#: commit from the specified user on GitHub.
|
||||
#: commit from the provided user on GitHub.
|
||||
|
||||
require "net/http"
|
||||
require "net/https"
|
||||
@ -74,12 +74,12 @@ module Homebrew
|
||||
def pull_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`pull` [<options>] <formula>:
|
||||
`pull` [<options>] <patch sources>:
|
||||
|
||||
Gets a patch from a GitHub commit or pull request and applies it to Homebrew.
|
||||
Optionally, installs the formulae changed by the patch.
|
||||
Get a patch from a GitHub commit or pull request and apply it to Homebrew.
|
||||
Optionally, publish updated bottles for the formulae changed by the patch.
|
||||
|
||||
Each <patch-source> may be one of:
|
||||
Each <patch source> may be one of:
|
||||
|
||||
~ The ID number of a PR (pull request) in the homebrew/core GitHub
|
||||
repository
|
||||
@ -112,9 +112,9 @@ module Homebrew
|
||||
switch "--warn-on-publish-failure",
|
||||
description: "Do not exit if there's a failure publishing bottles on Bintray."
|
||||
flag "--bintray-org=",
|
||||
description: "Publish at the given Bintray organisation."
|
||||
description: "Publish bottles at the provided Bintray <organisation>."
|
||||
flag "--test-bot-user=",
|
||||
description: "Pull the bottle block commit from the specified user on GitHub."
|
||||
description: "Pull the bottle block commit from the provided <user> on GitHub."
|
||||
switch :verbose
|
||||
switch :debug
|
||||
end
|
||||
|
@ -1,9 +1,9 @@
|
||||
#: * `release-notes` [`--markdown`] [<previous_tag>] [<end_ref>]:
|
||||
#: Output the merged pull requests on Homebrew/brew between two Git refs.
|
||||
#: Print the merged pull requests on Homebrew/brew between two Git refs.
|
||||
#: If no <previous_tag> is provided it defaults to the latest tag.
|
||||
#: If no <end_ref> is provided it defaults to `origin/master`.
|
||||
#:
|
||||
#: If `--markdown` is passed, output as a Markdown list.
|
||||
#: If `--markdown` is passed, print as a Markdown list.
|
||||
|
||||
require "cli_parser"
|
||||
|
||||
@ -15,12 +15,12 @@ module Homebrew
|
||||
usage_banner <<~EOS
|
||||
`release-notes` [<options>] [<previous_tag>] [<end_ref>]:
|
||||
|
||||
Output the merged pull requests on Homebrew/brew between two Git refs.
|
||||
Print the merged pull requests on Homebrew/brew between two Git refs.
|
||||
If no <previous_tag> is provided it defaults to the latest tag.
|
||||
If no <end_ref> is provided it defaults to `origin/master`.
|
||||
EOS
|
||||
switch "--markdown",
|
||||
description: "Output as a Markdown list."
|
||||
description: "Print as a Markdown list."
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -7,23 +7,15 @@ require "cli_parser"
|
||||
module Homebrew
|
||||
module_function
|
||||
|
||||
def write_path(tap, filename, content)
|
||||
path = tap.path/filename
|
||||
tap.path.mkpath
|
||||
raise "#{path} already exists" if path.exist?
|
||||
|
||||
path.write content
|
||||
end
|
||||
|
||||
def tap_new_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`tap-new` <user>/<repo>:
|
||||
`tap-new` <user>`/`<repo>:
|
||||
|
||||
Generate the template files for a new tap.
|
||||
EOS
|
||||
switch :debug
|
||||
switch :verbose
|
||||
switch :debug
|
||||
end
|
||||
end
|
||||
|
||||
@ -84,4 +76,12 @@ module Homebrew
|
||||
YAML
|
||||
write_path(tap, ".travis.yml", travis)
|
||||
end
|
||||
|
||||
def write_path(tap, filename, content)
|
||||
path = tap.path/filename
|
||||
tap.path.mkpath
|
||||
raise "#{path} already exists" if path.exist?
|
||||
|
||||
path.write content
|
||||
end
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
#: * `tests` [`--verbose`] [`--coverage`] [`--generic`] [`--no-compat`] [`--only=`<test_script>[`:`<line_number>]] [`--seed=`<seed>] [`--online`] [`--official-cmd-taps`]:
|
||||
#: * `tests` [`--verbose`] [`--coverage`] [`--generic`] [`--no-compat`] [`--only=`<test_script>[`:`<line_number>]] [`--seed=`<seed>] [`--online`]:
|
||||
#: Run Homebrew's unit and integration tests. If provided,
|
||||
#: `--only=`<test_script> runs only <test_script>_spec.rb, and `--seed`
|
||||
#: `--only=`<test_script> runs only <test_script>`_spec.rb`, and `--seed`
|
||||
#: randomizes tests with the provided value instead of a random seed.
|
||||
#:
|
||||
#: If `--verbose` (or `-v`) is passed, print the command that runs the tests.
|
||||
@ -26,9 +26,7 @@ module Homebrew
|
||||
usage_banner <<~EOS
|
||||
`tests` [<options>]:
|
||||
|
||||
Run Homebrew's unit and integration tests. If provided,
|
||||
`--only=`<test_script> runs only <test_script>_spec.rb, and `--seed`
|
||||
randomizes tests with the provided value instead of a random seed.
|
||||
Run Homebrew's unit and integration tests.
|
||||
EOS
|
||||
switch "--coverage",
|
||||
description: "Generate code coverage reports."
|
||||
@ -40,9 +38,10 @@ module Homebrew
|
||||
description: "Include tests that use the GitHub API and tests that use any of the taps for "\
|
||||
"official external commands."
|
||||
flag "--only=",
|
||||
description: "Run only <test_script>_spec.rb"
|
||||
description: "Run only <test_script>`_spec.rb`. Appending `:`<line_number> will start at a "\
|
||||
"specific line."
|
||||
flag "--seed=",
|
||||
description: "Randomizes tests with the provided value instead of a random seed."
|
||||
description: "Randomize tests with the provided <value> instead of a random seed."
|
||||
switch :verbose
|
||||
switch :debug
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
#: * `update-test` [`--commit=`<commit>] [`--before=`<date>] [`--to-tag`] [`--keep-tmp`]:
|
||||
#: Runs a test of `brew update` with a new repository clone.
|
||||
#: Run a test of `brew update` with a new repository clone.
|
||||
#:
|
||||
#: If no arguments are passed, use `origin/master` as the start commit.
|
||||
#:
|
||||
@ -24,8 +24,7 @@ module Homebrew
|
||||
usage_banner <<~EOS
|
||||
`update-test` [<options>]:
|
||||
|
||||
Runs a test of `brew update` with a new repository clone.
|
||||
|
||||
Run a test of `brew update` with a new repository clone.
|
||||
If no arguments are passed, use `origin/master` as the start commit.
|
||||
EOS
|
||||
switch "--to-tag",
|
||||
|
@ -8,7 +8,7 @@ describe "brew bottle", :integration_test do
|
||||
(HOMEBREW_CELLAR/"patchelf/1.0/bin").mkpath
|
||||
|
||||
expect { brew "bottle", "--no-rebuild", testball }
|
||||
.to output(/Formula not from core or any taps/).to_stderr
|
||||
.to output(/Formula not from core or any installed taps/).to_stderr
|
||||
.and not_to_output.to_stdout
|
||||
.and be_a_failure
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user