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_function
|
||||
|
||||
def extract
|
||||
Homebrew::CLI::Parser.parse do
|
||||
flag "--version="
|
||||
def extract_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
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 :force
|
||||
end
|
||||
end
|
||||
|
||||
def extract
|
||||
extract_args.parse
|
||||
|
||||
# Expect exactly two named arguments: formula and tap
|
||||
raise UsageError if ARGV.named.length != 2
|
||||
|
@ -21,6 +21,7 @@ require "dev-cmd/irb"
|
||||
require "dev-cmd/linkage"
|
||||
require "dev-cmd/mirror"
|
||||
require "dev-cmd/pull"
|
||||
require "dev-cmd/extract"
|
||||
require "dev-cmd/release-notes"
|
||||
require "dev-cmd/tap-new"
|
||||
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.
|
||||
|
||||
|
||||
* `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
|
||||
if it already exists. Otherwise, existing files will be preserved.
|
||||
|
||||
If an argument is passed through `--version`, `version` of `formula`
|
||||
will be extracted and placed in the destination tap. Otherwise, the most
|
||||
recent version that can be found will be used.
|
||||
* `--version`:
|
||||
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.
|
||||
|
||||
###`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:"
|
||||
Open \fIformula\fR in the editor\. Open all of Homebrew for editing if no \fIformula\fR is provided\.
|
||||
.
|
||||
.TP
|
||||
\fBextract\fR [\fB\-\-force\fR] \fIformula\fR \fItap\fR [\fB\-\-version=\fR\fIversion\fR]
|
||||
.SS "\fBextract\fR [\fIoptions\fR] \fIformula\fR \fItap\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\.
|
||||
.
|
||||
.IP
|
||||
If \fB\-\-force\fR is passed, the file at the destination will be overwritten if it already exists\. Otherwise, existing files will be preserved\.
|
||||
.
|
||||
.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\.
|
||||
.TP
|
||||
\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\.
|
||||
.
|
||||
.SS "\fBformula\fR \fIformula\fR:"
|
||||
Display the path where \fIformula\fR is located\.
|
||||
|
Loading…
x
Reference in New Issue
Block a user