mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
extract: Add option descriptions
This commit is contained in:
parent
f6081d6ab0
commit
38feaf1270
@ -96,12 +96,26 @@ end
|
|||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
def extract
|
def extract_args
|
||||||
Homebrew::CLI::Parser.parse do
|
Homebrew::CLI::Parser.new do
|
||||||
flag "--version="
|
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.
|
||||||
|
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
|
switch :debug
|
||||||
switch :force
|
switch :force
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def extract
|
||||||
|
extract_args.parse
|
||||||
|
|
||||||
# Expect exactly two named arguments: formula and tap
|
# Expect exactly two named arguments: formula and tap
|
||||||
raise UsageError if ARGV.named.length != 2
|
raise UsageError if ARGV.named.length != 2
|
||||||
|
@ -21,6 +21,7 @@ require "dev-cmd/irb"
|
|||||||
require "dev-cmd/linkage"
|
require "dev-cmd/linkage"
|
||||||
require "dev-cmd/mirror"
|
require "dev-cmd/mirror"
|
||||||
require "dev-cmd/pull"
|
require "dev-cmd/pull"
|
||||||
|
require "dev-cmd/extract"
|
||||||
require "dev-cmd/release-notes"
|
require "dev-cmd/release-notes"
|
||||||
require "dev-cmd/tap-new"
|
require "dev-cmd/tap-new"
|
||||||
require "dev-cmd/tests"
|
require "dev-cmd/tests"
|
||||||
|
@ -794,17 +794,14 @@ Takes a tap [`user``/``repo`] as argument and generates the formula in the speci
|
|||||||
no `formula` is provided.
|
no `formula` is provided.
|
||||||
|
|
||||||
|
|
||||||
* `extract` [`--force`] `formula` `tap` [`--version=``version`]:
|
###`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.
|
|
||||||
|
|
||||||
If `--force` is passed, the file at the destination will be overwritten
|
Looks through repository history to find the `version` of `formula` and
|
||||||
if it already exists. Otherwise, existing files will be preserved.
|
creates a copy in `tap`/Formula/`formula`@`version`.rb. If the tap is
|
||||||
|
not installed yet, attempts to install/clone the tap before continuing.
|
||||||
|
|
||||||
If an argument is passed through `--version`, `version` of `formula`
|
* `--version`:
|
||||||
will be extracted and placed in the destination tap. Otherwise, the most
|
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.
|
||||||
recent version that can be found will be used.
|
|
||||||
|
|
||||||
###`formula` `formula`:
|
###`formula` `formula`:
|
||||||
|
|
||||||
|
@ -794,15 +794,12 @@ Takes a tap [\fIuser\fR\fB/\fR\fIrepo\fR] as argument and generates the formula
|
|||||||
.SS "\fBedit\fR \fIformula\fR:"
|
.SS "\fBedit\fR \fIformula\fR:"
|
||||||
Open \fIformula\fR in the editor\. Open all of Homebrew for editing if no \fIformula\fR is provided\.
|
Open \fIformula\fR in the editor\. Open all of Homebrew for editing if no \fIformula\fR is provided\.
|
||||||
.
|
.
|
||||||
.TP
|
.SS "\fBextract\fR [\fIoptions\fR] \fIformula\fR \fItap\fR"
|
||||||
\fBextract\fR [\fB\-\-force\fR] \fIformula\fR \fItap\fR [\fB\-\-version=\fR\fIversion\fR]
|
|
||||||
Looks through repository history to find the \fIversion\fR of \fIformula\fR and creates a copy in \fItap\fR/Formula/\fIformula\fR@\fIversion\fR\.rb\. If the tap is not installed yet, attempts to install/clone the tap before continuing\.
|
Looks through repository history to find the \fIversion\fR of \fIformula\fR and creates a copy in \fItap\fR/Formula/\fIformula\fR@\fIversion\fR\.rb\. If the tap is not installed yet, attempts to install/clone the tap before continuing\.
|
||||||
.
|
.
|
||||||
.IP
|
.TP
|
||||||
If \fB\-\-force\fR is passed, the file at the destination will be overwritten if it already exists\. Otherwise, existing files will be preserved\.
|
\fB\-\-version\fR
|
||||||
.
|
Provided \fIversion\fR of \fIformula\fR will be extracted and placed in the destination tap\. Otherwise, the most recent version that can be found will be used\.
|
||||||
.IP
|
|
||||||
If an argument is passed through \fB\-\-version\fR, \fIversion\fR of \fIformula\fR will be extracted and placed in the destination tap\. Otherwise, the most recent version that can be found will be used\.
|
|
||||||
.
|
.
|
||||||
.SS "\fBformula\fR \fIformula\fR:"
|
.SS "\fBformula\fR \fIformula\fR:"
|
||||||
Display the path where \fIformula\fR is located\.
|
Display the path where \fIformula\fR is located\.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user