2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-05-03 08:22:28 -04:00
|
|
|
require "net/http"
|
|
|
|
require "net/https"
|
2016-11-20 13:00:01 -05:00
|
|
|
require "json"
|
2019-04-17 18:25:08 +09:00
|
|
|
require "cli/parser"
|
2015-08-03 13:09:07 +01:00
|
|
|
require "formula"
|
2016-05-03 08:22:28 -04:00
|
|
|
require "formulary"
|
|
|
|
require "version"
|
|
|
|
require "pkg_version"
|
2019-04-27 00:17:48 +02:00
|
|
|
require "formula_info"
|
2014-09-20 14:27:54 +01:00
|
|
|
|
|
|
|
module Homebrew
|
2016-09-26 01:44:51 +02:00
|
|
|
module_function
|
|
|
|
|
2018-07-30 18:25:38 +05:30
|
|
|
def pull_args
|
|
|
|
Homebrew::CLI::Parser.new do
|
2020-06-05 08:53:03 +01:00
|
|
|
hide_from_man_page!
|
2018-09-28 21:39:52 +05:30
|
|
|
usage_banner <<~EOS
|
2019-01-30 21:33:03 +00:00
|
|
|
`pull` [<options>] <patch>
|
2018-09-28 21:39:52 +05:30
|
|
|
|
2018-10-08 22:49:03 -04:00
|
|
|
Get a patch from a GitHub commit or pull request and apply it to Homebrew.
|
2018-10-02 19:54:22 +05:30
|
|
|
|
2020-04-18 12:13:43 -04:00
|
|
|
Each <patch> may be the number of a pull request in `homebrew/core`
|
|
|
|
or the URL of any pull request or commit on GitHub.
|
2018-09-28 21:39:52 +05:30
|
|
|
EOS
|
|
|
|
switch "--bump",
|
2019-04-30 08:44:35 +01:00
|
|
|
description: "For one-formula PRs, automatically reword commit message to our preferred format."
|
2018-09-28 21:39:52 +05:30
|
|
|
switch "--clean",
|
2019-04-30 08:44:35 +01:00
|
|
|
description: "Do not rewrite or otherwise modify the commits found in the pulled PR."
|
2018-09-28 21:39:52 +05:30
|
|
|
switch "--ignore-whitespace",
|
2019-04-30 08:44:35 +01:00
|
|
|
description: "Silently ignore whitespace discrepancies when applying diffs."
|
2018-09-28 21:39:52 +05:30
|
|
|
switch "--resolve",
|
2019-04-30 08:44:35 +01:00
|
|
|
description: "When a patch fails to apply, leave in progress and allow user to resolve, instead "\
|
|
|
|
"of aborting."
|
2018-09-28 21:39:52 +05:30
|
|
|
switch "--branch-okay",
|
2019-04-30 08:44:35 +01:00
|
|
|
description: "Do not warn if pulling to a branch besides master (useful for testing)."
|
2018-09-28 21:39:52 +05:30
|
|
|
switch "--no-pbcopy",
|
2019-04-30 08:44:35 +01:00
|
|
|
description: "Do not copy anything to the system clipboard."
|
2020-07-30 18:40:10 +02:00
|
|
|
|
2020-03-04 17:28:24 +00:00
|
|
|
min_named 1
|
2018-03-25 19:08:17 +05:30
|
|
|
end
|
2018-07-30 18:25:38 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def pull
|
2020-09-03 10:34:22 +01:00
|
|
|
odisabled "brew pull", "hub checkout"
|
2017-03-05 15:01:28 -05:00
|
|
|
end
|
2014-09-20 14:27:54 +01:00
|
|
|
end
|