diff --git a/Library/Homebrew/cli_parser.rb b/Library/Homebrew/cli_parser.rb index fb260d35d8..17b21cdca7 100644 --- a/Library/Homebrew/cli_parser.rb +++ b/Library/Homebrew/cli_parser.rb @@ -5,10 +5,21 @@ require "set" module Homebrew module CLI class Parser + attr_reader :processed_options + def self.parse(args = ARGV, &block) new(&block).parse(args) end + def self.global_options + { + quiet: [["-q", "--quiet"], :quiet, "Suppress any warnings."], + verbose: [["-v", "--verbose"], :verbose, "Make some output more verbose."], + debug: [["-d", "--debug"], :debug, "Display any debugging information."], + force: [["-f", "--force"], :force, "Override warnings and enable potentially unsafe operations."], + } + end + def initialize(&block) @parser = OptionParser.new Homebrew.args = OpenStruct.new @@ -16,14 +27,25 @@ module Homebrew Homebrew.args.instance_eval { undef tap } @constraints = [] @conflicts = [] + @processed_options = [] + @desc_line_length = 48 instance_eval(&block) + post_initialize + end + + def post_initialize + @parser.on_tail("-h", "--help", "Show this message") do + puts generate_help_text + exit 0 + end end def switch(*names, description: nil, env: nil, required_for: nil, depends_on: nil) - description = option_to_description(*names) if description.nil? global_switch = names.first.is_a?(Symbol) - names, env = common_switch(*names) if global_switch - @parser.on(*names, description) do + names, env, description = common_switch(*names) if global_switch + description = option_to_description(*names) if description.nil? + process_option(*names, description) + @parser.on(*names, *wrap_option_desc(description)) do enable_switch(*names) end @@ -34,9 +56,18 @@ module Homebrew enable_switch(*names) if !env.nil? && !ENV["HOMEBREW_#{env.to_s.upcase}"].nil? end + def usage_banner(text) + @parser.banner = "#{text}\n" + end + + def usage_banner_text + @parser.banner + end + def comma_array(name, description: nil) description = option_to_description(name) if description.nil? - @parser.on(name, OptionParser::REQUIRED_ARGUMENT, Array, description) do |list| + process_option(name, description) + @parser.on(name, OptionParser::REQUIRED_ARGUMENT, Array, *wrap_option_desc(description)) do |list| Homebrew.args[option_to_name(name)] = list end end @@ -49,7 +80,8 @@ module Homebrew required = OptionParser::OPTIONAL_ARGUMENT end description = option_to_description(name) if description.nil? - @parser.on(name, description, required) do |option_value| + process_option(name, description) + @parser.on(name, *wrap_option_desc(description), required) do |option_value| Homebrew.args[option_to_name(name)] = option_value end @@ -78,10 +110,26 @@ module Homebrew names.map { |name| name.to_s.sub(/\A--?/, "").tr("-", " ") }.max end - def parse(cmdline_args) + def summary + @parser.to_s + end + + def parse(cmdline_args = ARGV) remaining_args = @parser.parse(cmdline_args) check_constraint_violations Homebrew.args[:remaining] = remaining_args + @parser + end + + def global_option?(name) + Homebrew::CLI::Parser.global_options.key?(name.to_sym) + end + + def generate_help_text + @parser.to_s.sub(/^/, "#{Tty.bold}Usage: brew#{Tty.reset} ") + .gsub(/`(.*?)`/, "#{Tty.bold}\\1#{Tty.reset}") + .gsub(%r{<([^\s]+?://[^\s]+?)>}) { |url| Formatter.url(url) } + .gsub(/<(.*?)>/, "#{Tty.underline}\\1#{Tty.reset}") end private @@ -94,19 +142,17 @@ module Homebrew # These are common/global switches accessible throughout Homebrew def common_switch(name) - case name - when :quiet then [["-q", "--quiet"], :quiet] - when :verbose then [["-v", "--verbose"], :verbose] - when :debug then [["-d", "--debug"], :debug] - when :force then [["-f", "--force"], :force] - else name - end + Homebrew::CLI::Parser.global_options.fetch(name, name) end def option_passed?(name) Homebrew.args.respond_to?(name) || Homebrew.args.respond_to?("#{name}?") end + def wrap_option_desc(desc) + Formatter.wrap(desc, @desc_line_length).split("\n") + end + def set_constraints(name, depends_on:, required_for:) secondary = option_to_name(name) unless required_for.nil? @@ -160,6 +206,11 @@ module Homebrew check_conflicts check_constraints end + + def process_option(*args) + option, = @parser.make_switch(args) + @processed_options << [option.short.first, option.long.first, option.arg, option.desc.first] + end end class OptionConstraintError < RuntimeError diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 18efdd7ee2..9cfb793344 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -52,22 +52,51 @@ require "cli_parser" module Homebrew module_function - def audit - Homebrew::CLI::Parser.parse do - switch "--strict" - switch "--online" - switch "--new-formula" - switch "--fix" - switch "--display-cop-names" - switch "--display-filename" - switch "-D", "--audit-debug", description: "Activates debugging and profiling" - switch :verbose - switch :debug - comma_array "--only" - comma_array "--except" - comma_array "--only-cops" - comma_array "--except-cops" + def audit_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `audit` [] : + + Check for Homebrew coding style violations. This should be + run before submitting a new formula. + If no are provided, all of them are checked. + EOS + switch "--strict", + 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", + description: "Run various additional style checks to determine if a new formula is eligible "\ + "for Homebrew. This should be used when creating new formula and implies "\ + "`--strict` and `--online`." + switch "--fix", + description: "Fix style violations automatically using RuboCop's auto-correct feature." + switch "--display-cop-names", + description: "Include the RuboCop cop name for each violation in the output." + switch "--display-filename", + description: "Prefix everyline 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" + comma_array "--only", + description: "Passing `--only`= will run only the methods named audit_, `method` "\ + "should be a comma-separated list." + comma_array "--except", + description: "Passing `--except`= will run only the methods named audit_, "\ + "`method` should be a comma-separated list." + comma_array "--only-cops", + description: "Passing `--only-cops`= will check for violations of only the listed "\ + "RuboCop cops. `cops` should be a comma-separated list of cop names." + comma_array "--except-cops", + description: "Passing `--except-cops`= will skip checking the listed RuboCop cops "\ + "violations. `cops` should be a comma-separated list of cop names." + switch :verbose + switch :debug end + end + + def audit + audit_args.parse Homebrew.auditing = true inject_dump_stats!(FormulaAuditor, /^audit_/) if args.audit_debug? diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 26ba126fdd..3f43214f02 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -69,21 +69,51 @@ MAXIMUM_STRING_MATCHES = 100 module Homebrew module_function - def bottle - Homebrew::CLI::Parser.parse do - switch "--merge" - switch "--skip-relocation" - switch "--force-core-tap" - switch "--no-rebuild" - switch "--keep-old" - switch "--write" - switch "--no-commit" - switch "--json" - switch "--or-later" + def bottle_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `bottle` [] : + + Generate a bottle (binary package) from a formula 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. + EOS + switch "--skip-relocation", + description: "Do not check if the bottle can be marked as relocatable." + switch "--or-later", + description: "Append `_or_later` to the bottle tag." + switch "--force-core-tap", + description: "Build a bottle even if 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." + switch "--keep-old", + description: "If the formula specifies a rebuild version, it will attempted to be kept 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`." + flag "--root-url", + description: "Use the specified as the root of the bottle's URL instead of Homebrew's "\ + "default." switch :verbose switch :debug - flag "--root-url" end + end + + def bottle + bottle_args.parse return merge if args.merge? diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 5dc47299ca..2cd9ed86f2 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -47,29 +47,68 @@ require "cli_parser" module Homebrew module_function - def bump_formula_pr - Homebrew::CLI::Parser.parse do - switch "--devel" - switch "-n", "--dry-run" - switch "--write" - switch "--audit" - switch "--strict" - switch "--no-browse" - switch :quiet - switch :force - switch :verbose - switch :debug + def bump_formula_pr_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `bump-formula-pr` [] : - flag "--url=" - flag "--revision=" - flag "--tag=", required_for: "--revision=" - flag "--sha256=", depends_on: "--url=" - flag "--mirror=" - flag "--version=" - flag "--message=" + Creates a pull request to update the formula with a new URL or a new tag. + If a is specified, the checksum of the new download must + also be specified. A best effort to determine the and + name will be made if either or both values are not supplied by the user. + + If a is specified, the git commit 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. + 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." + 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 for the formula. If a is specified, the "\ + "checksum of the new download must also be specified." + flag "--revision=", + description: "Specify the new git commit corresponding to a specified ." + flag "--tag=", + required_for: "--revision=", + description: "Specify the new git commit for the formula." + flag "--sha256=", + depends_on: "--url=", + description: "Specify the checksum of new download." + flag "--mirror=", + description: "Use the provided as a mirror URL." + flag "--version=", + description: "Use the provided 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." + flag "--message=", + description: "Append provided to the default PR message." + + switch :quiet + switch :force + switch :verbose + switch :debug conflicts "--url", "--tag" end + end + + def bump_formula_pr + bump_formula_pr_args.parse # As this command is simplifying user run commands then let's just use a # user path, too. diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb index 0323722bcf..f5f174f12f 100644 --- a/Library/Homebrew/dev-cmd/create.rb +++ b/Library/Homebrew/dev-cmd/create.rb @@ -27,21 +27,45 @@ require "cli_parser" module Homebrew module_function - # Create a formula from a tarball URL - def create - Homebrew::CLI::Parser.parse do - switch "--autotools" - switch "--cmake" - switch "--meson" - switch "--no-fetch" + def create_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `create` []: + + Generate a formula for the downloadable file at 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 + . + EOS + switch "--autotools", + description: "Create a basic template for an Autotools-style build." + switch "--cmake", + description: "Create a basic template for a CMake-style build." + switch "--meson", + description: "Create a basic template for a Meson-style build." + switch "--no-fetch", + description: "Homebrew will not download 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" + flag "--set-name=", + description: "Set the provided name of the package you are creating." + flag "--set-version=", + description: "Set the provided version of the package you are creating." + flag "--tap=", + description: "Takes a tap [`/`] as argument and generates the formula in the "\ + "specified tap." switch :force switch :verbose switch :debug - flag "--set-name=" - flag "--set-version=" - flag "--tap=" end + end + + # Create a formula from a tarball URL + def create + create_args.parse + raise UsageError if ARGV.named.empty? # Ensure that the cache exists so we can fetch the tarball diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index 62def730db..42d7ecf941 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -10,12 +10,21 @@ require "cli_parser" module Homebrew module_function - def edit - Homebrew::CLI::Parser.parse do + def edit_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `edit` : + Open in the editor. Open all of Homebrew for editing if + no is provided. + EOS switch :force switch :verbose switch :debug end + end + + def edit + edit_args.parse unless (HOMEBREW_REPOSITORY/".git").directory? raise <<~EOS diff --git a/Library/Homebrew/dev-cmd/extract.rb b/Library/Homebrew/dev-cmd/extract.rb index cce25a171e..7f3c89ac67 100644 --- a/Library/Homebrew/dev-cmd/extract.rb +++ b/Library/Homebrew/dev-cmd/extract.rb @@ -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` [] + + Looks through repository history to find the of and + creates a copy in /Formula/@.rb. If the tap is + not installed yet, attempts to install/clone the tap before continuing. + EOS + + flag "--version=", + description: "Provided of 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 diff --git a/Library/Homebrew/dev-cmd/formula.rb b/Library/Homebrew/dev-cmd/formula.rb index 71cecdeb5d..904f8e2aa6 100644 --- a/Library/Homebrew/dev-cmd/formula.rb +++ b/Library/Homebrew/dev-cmd/formula.rb @@ -7,11 +7,20 @@ require "cli_parser" module Homebrew module_function - def formula - Homebrew::CLI::Parser.parse do + def formula_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `formula` : + + Display the path where is located. + EOS switch :debug switch :verbose end + end + + def formula + formula_args.parse raise FormulaUnspecifiedError if ARGV.named.empty? diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index 7f5cd77f15..816ab6047c 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -22,11 +22,23 @@ end module Homebrew module_function - def irb - Homebrew::CLI::Parser.parse do - switch "--examples" - switch "--pry", env: :pry + def irb_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `irb` []: + + Enter the interactive Homebrew Ruby shell. + EOS + switch "--examples", + 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." end + end + + def irb + irb_args.parse if args.examples? puts "'v8'.f # => instance of the v8 formula" diff --git a/Library/Homebrew/dev-cmd/linkage.rb b/Library/Homebrew/dev-cmd/linkage.rb index 2fa90a6a68..2feb98f899 100644 --- a/Library/Homebrew/dev-cmd/linkage.rb +++ b/Library/Homebrew/dev-cmd/linkage.rb @@ -19,13 +19,32 @@ require "cli_parser" module Homebrew module_function - def linkage - Homebrew::CLI::Parser.parse do - switch "--test" - switch "--reverse" + def linkage_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `linkage` [] : + + Checks the library links of an installed formula. + + Only works on installed formulae. An error is raised if it is 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." + switch "--reverse", + description: "Print the dylib followed by the binaries which link to it for each library the keg "\ + "references." + switch "--cached", + description: "Print the cached linkage values stored in HOMEBREW_CACHE, set from a previous "\ + "`brew linkage` run." switch :verbose switch :debug end + end + + def linkage + linkage_args.parse CacheStoreDatabase.use(:linkage) do |db| kegs = if ARGV.kegs.empty? diff --git a/Library/Homebrew/dev-cmd/man.rb b/Library/Homebrew/dev-cmd/man.rb index a6ee8058ca..0cad8e98a5 100644 --- a/Library/Homebrew/dev-cmd/man.rb +++ b/Library/Homebrew/dev-cmd/man.rb @@ -11,6 +11,21 @@ require "formula" require "erb" require "ostruct" require "cli_parser" +require "dev-cmd/audit" +require "dev-cmd/bottle" +require "dev-cmd/bump-formula-pr" +require "dev-cmd/create" +require "dev-cmd/edit" +require "dev-cmd/formula" +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" +require "dev-cmd/update-test" module Homebrew module_function @@ -19,11 +34,25 @@ module Homebrew TARGET_MAN_PATH = HOMEBREW_REPOSITORY/"manpages" TARGET_DOC_PATH = HOMEBREW_REPOSITORY/"docs" - def man - Homebrew::CLI::Parser.parse do - switch "--fail-if-changed" - switch "--link" + def man_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `man` []: + + Generate Homebrew's manpages. + EOS + switch "--fail-if-changed", + description: "Return a failing status code if changes are detected in the manpage outputs. This "\ + "can be used for CI to be notified when the manpages are out of date. Additionally, "\ + "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`." end + end + + def man + man_args.parse raise UsageError unless ARGV.named.empty? @@ -53,7 +82,6 @@ module Homebrew def path_glob_commands(glob) Pathname.glob(glob) - .sort_by { |source_file| sort_key_for_path(source_file) } .map(&:read).map(&:lines) .map { |lines| lines.grep(/^#:/).map { |line| line.slice(2..-1) }.join } .reject { |s| s.strip.empty? || s.include?("@hide_from_man_page") } @@ -64,7 +92,9 @@ module Homebrew variables = OpenStruct.new variables[:commands] = path_glob_commands("#{HOMEBREW_LIBRARY_PATH}/cmd/*.{rb,sh}") - variables[:developer_commands] = path_glob_commands("#{HOMEBREW_LIBRARY_PATH}/dev-cmd/*.{rb,sh}") + + variables[:developer_commands] = generate_cmd_manpages("#{HOMEBREW_LIBRARY_PATH}/dev-cmd/*.{rb,sh}") + variables[:global_options] = global_options_manpage_lines readme = HOMEBREW_REPOSITORY/"README.md" variables[:lead_maintainer] = readme.read[/(Homebrew's lead maintainer .*\.)/, 1] @@ -127,6 +157,10 @@ module Homebrew ronn_output = ronn.read odie "Got no output from ronn!" unless ronn_output ronn_output.gsub!(%r{`(?=[.!?,;:]?\s)}, "").gsub!(%r{}, "`") if format_flag == "--markdown" + unless format_flag == "--markdown" + ronn_output = ronn_output.gsub(%r{(.*?)}, "\\fB\\1\\fR") + .gsub(%r{(.*?)}, "\\fI\\1\\fR") + end target.atomic_write ronn_output end end @@ -145,4 +179,56 @@ module Homebrew odie "Failed to infer output format from '#{target.basename}'." end end + + def generate_cmd_manpages(glob) + cmd_paths = Pathname.glob(glob) + man_page_lines = [] + cmd_paths.each do |cmd_path| + begin + cmd_parser = Homebrew.send(cmd_arg_parser(cmd_path)) + man_page_lines << cmd_manpage_lines(cmd_parser).join + rescue NoMethodError + man_page_lines << path_glob_commands(cmd_path.to_s).first + end + end + man_page_lines + end + + def cmd_arg_parser(cmd_path) + "#{cmd_path.basename.to_s.gsub(".rb", "").tr("-", "_")}_args".to_sym + end + + def cmd_manpage_lines(cmd_parser) + lines = [format_usage_banner(cmd_parser.usage_banner_text)] + lines += cmd_parser.processed_options.map do |short, long, _, desc| + next if !long.nil? && cmd_parser.global_option?(cmd_parser.option_to_name(long)) + generate_option_doc(short, long, desc) + end + lines + end + + def global_options_manpage_lines + lines = ["These options are applicable across all sub-commands.\n"] + lines += Homebrew::CLI::Parser.global_options.values.map do |names, _, desc| + short, long = names + generate_option_doc(short, long, desc) + end + lines + end + + def generate_option_doc(short, long, desc) + "* #{format_short_opt(short)} #{format_long_opt(long)}:" + "\n" + desc + "\n" + end + + def format_short_opt(opt) + "`#{opt}`, " unless opt.nil? + end + + def format_long_opt(opt) + "`#{opt}`" + end + + def format_usage_banner(usage_banner) + usage_banner.sub(/^/, "###") + end end diff --git a/Library/Homebrew/dev-cmd/mirror.rb b/Library/Homebrew/dev-cmd/mirror.rb index 763d55092d..a707e1dc7e 100644 --- a/Library/Homebrew/dev-cmd/mirror.rb +++ b/Library/Homebrew/dev-cmd/mirror.rb @@ -7,11 +7,20 @@ require "cli_parser" module Homebrew module_function - def mirror - Homebrew::CLI::Parser.parse do + def mirror_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `mirror` : + + Reuploads the stable URL for a formula to Bintray to use it as a mirror. + EOS switch :debug switch :verbose end + end + + def mirror + mirror_args.parse odie "This command requires at least formula argument!" if ARGV.named.empty? diff --git a/Library/Homebrew/dev-cmd/prof.rb b/Library/Homebrew/dev-cmd/prof.rb index c7121f6e85..f2750e83c2 100644 --- a/Library/Homebrew/dev-cmd/prof.rb +++ b/Library/Homebrew/dev-cmd/prof.rb @@ -1,7 +1,7 @@ #: * `prof` []: #: Run Homebrew with the Ruby profiler. #: For example: -# brew prof readall +#: brew prof readall module Homebrew module_function diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb index 5001da9181..7f51c68c4b 100644 --- a/Library/Homebrew/dev-cmd/pull.rb +++ b/Library/Homebrew/dev-cmd/pull.rb @@ -72,24 +72,59 @@ end module Homebrew module_function + def pull_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + pull [] : + + Gets a patch from a GitHub commit or pull request and applies it to Homebrew. + Optionally, installs the formulae changed by the patch. + + Each may be one of: + + ~ The ID number of a PR (pull request) in the homebrew/core GitHub + repository + + ~ The URL of a PR on GitHub, using either the web page or API URL + formats. In this form, the PR may be on Homebrew/brew, + Homebrew/homebrew-core or any tap. + + ~ The URL of a commit on GitHub + + ~ A "https://jenkins.brew.sh/job/..." string specifying a testing job ID + EOS + switch "--bottle", + description: "Handle bottles, pulling the bottle-update commit and publishing files on Bintray." + switch "--bump", + description: "For one-formula PRs, automatically reword commit message to our preferred format." + switch "--clean", + description: "Do not rewrite or otherwise modify the commits found in the pulled PR." + switch "--ignore-whitespace", + description: "Silently ignore whitespace discrepancies when applying diffs." + switch "--resolve", + description: "When a patch fails to apply, leave in progress and allow user to resolve, instead "\ + "of aborting." + switch "--branch-okay", + description: "Do not warn if pulling to a branch besides master (useful for testing)." + switch "--no-pbcopy", + description: "Do not copy anything to the system clipboard." + switch "--no-publish", + description: "Do not publish bottles to Bintray." + 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." + flag "--test-bot-user=", + description: "Pull the bottle block commit from the specified user on GitHub." + switch :verbose + switch :debug + end + end + def pull odie "You meant `git pull --rebase`." if ARGV[0] == "--rebase" - Homebrew::CLI::Parser.parse do - switch "--bottle" - switch "--bump" - switch "--clean" - switch "--ignore-whitespace" - switch "--resolve" - switch "--branch-okay" - switch "--no-pbcopy" - switch "--no-publish" - switch "--warn-on-publish-failure" - switch :verbose - switch :debug - flag "--bintray-org=" - flag "--test-bot-user=" - end + pull_args.parse if ARGV.named.empty? odie "This command requires at least one argument containing a URL or pull request number" diff --git a/Library/Homebrew/dev-cmd/release-notes.rb b/Library/Homebrew/dev-cmd/release-notes.rb index 1a6616e9a5..8445ee2d58 100644 --- a/Library/Homebrew/dev-cmd/release-notes.rb +++ b/Library/Homebrew/dev-cmd/release-notes.rb @@ -10,10 +10,22 @@ require "cli_parser" module Homebrew module_function - def release_notes - Homebrew::CLI::Parser.parse do - switch "--markdown" + def release_notes_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `release-notes` [] [] []: + + Output the merged pull requests on Homebrew/brew between two Git refs. + If no is provided it defaults to the latest tag. + If no is provided it defaults to `origin/master`. + EOS + switch "--markdown", + description: "Output as a Markdown list." end + end + + def release_notes + release_notes_args.parse previous_tag = ARGV.named.first previous_tag ||= Utils.popen_read( diff --git a/Library/Homebrew/dev-cmd/tap-new.rb b/Library/Homebrew/dev-cmd/tap-new.rb index 1be9f17640..92ff6a40b9 100644 --- a/Library/Homebrew/dev-cmd/tap-new.rb +++ b/Library/Homebrew/dev-cmd/tap-new.rb @@ -15,11 +15,20 @@ module Homebrew path.write content end - def tap_new - Homebrew::CLI::Parser.parse do + def tap_new_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `tap-new` /: + + Generate the template files for a new tap. + EOS switch :debug switch :verbose end + end + + def tap_new + tap_new_args.parse raise "A tap argument is required" if ARGV.named.empty? diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index 8b13301e95..add193d968 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -21,17 +21,35 @@ require "fileutils" module Homebrew module_function - def tests - Homebrew::CLI::Parser.parse do - switch "--no-compat" - switch "--generic" - switch "--coverage" - switch "--online" - switch :debug + def tests_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `tests` []: + + Run Homebrew's unit and integration tests. If provided, + `--only=` runs only _spec.rb, and `--seed` + randomizes tests with the provided value instead of a random seed. + EOS + switch "--coverage", + description: "Generate code coverage reports." + switch "--generic", + description: "Run only OS-agnostic tests." + switch "--no-compat", + description: "Do not load the compatibility layer when running tests." + switch "--online", + 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 _spec.rb" + flag "--seed=", + description: "Randomizes tests with the provided value instead of a random seed." switch :verbose - flag "--only=" - flag "--seed=" + switch :debug end + end + + def tests + tests_args.parse HOMEBREW_LIBRARY_PATH.cd do ENV.delete("HOMEBREW_COLOR") diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb index 072abdcca3..7a1ffef27f 100644 --- a/Library/Homebrew/dev-cmd/update-test.rb +++ b/Library/Homebrew/dev-cmd/update-test.rb @@ -19,15 +19,30 @@ require "cli_parser" module Homebrew module_function - def update_test - Homebrew::CLI::Parser.parse do - switch "--to-tag" - switch "--keep-tmp" + def update_test_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `update-test` []: + + Runs 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", + description: "Set `HOMEBREW_UPDATE_TO_TAG` to test updating between tags." + switch "--keep-tmp", + description: "Retain the temporary directory containing the new repository clone." + flag "--commit=", + description: "Use provided as the start commit." + flag "--before=", + description: "Use the commit at provided as the start commit." switch :verbose switch :debug - flag "--commit=" - flag "--before=" end + end + + def update_test + update_test_args.parse ENV["HOMEBREW_UPDATE_TEST"] = "1" diff --git a/Library/Homebrew/help.rb b/Library/Homebrew/help.rb index 76ddbb79e9..d541081c8d 100644 --- a/Library/Homebrew/help.rb +++ b/Library/Homebrew/help.rb @@ -75,6 +75,14 @@ module Homebrew end def command_help(path) + # Let OptionParser generate help text for commands which have a parser defined + begin + cmd = path.basename(path.extname) + return Homebrew.send("#{cmd.to_s.tr("-", "_")}_args".to_sym).generate_help_text + rescue NoMethodError + nil + end + help_lines = command_help_lines(path) if help_lines.empty? opoo "No help text in: #{path}" if ARGV.homebrew_developer? diff --git a/Library/Homebrew/manpages/brew.1.md.erb b/Library/Homebrew/manpages/brew.1.md.erb index 04804651e8..75bcf3416c 100644 --- a/Library/Homebrew/manpages/brew.1.md.erb +++ b/Library/Homebrew/manpages/brew.1.md.erb @@ -54,6 +54,10 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note <%= developer_commands.join("\n") %> +## GLOBAL OPTIONS + +<%= global_options.join("\n") %> + ## OFFICIAL EXTERNAL COMMANDS <%= homebrew_bundle.join("\n ").strip %> diff --git a/Library/Homebrew/test/cmd/help_spec.rb b/Library/Homebrew/test/cmd/help_spec.rb index 6d94d7444c..e3460dec0f 100644 --- a/Library/Homebrew/test/cmd/help_spec.rb +++ b/Library/Homebrew/test/cmd/help_spec.rb @@ -26,7 +26,7 @@ describe "brew", :integration_test do it "prints help for a documented Ruby developer command" do expect { brew "help", "update-test" } - .to output(/^brew update-test/).to_stdout + .to output(/^Usage: brew update-test/).to_stdout .and be_a_success end diff --git a/Library/Homebrew/utils/formatter.rb b/Library/Homebrew/utils/formatter.rb index 36542d7389..d8530414a0 100644 --- a/Library/Homebrew/utils/formatter.rb +++ b/Library/Homebrew/utils/formatter.rb @@ -31,6 +31,10 @@ module Formatter label(label, string, :red) end + def wrap(s, width = 172) + s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n") + end + def url(string) "#{Tty.underline}#{string}#{Tty.no_underline}" end diff --git a/docs/Manpage.md b/docs/Manpage.md index a1e5a0af6a..dea38a6dfb 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -37,6 +37,44 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note ## COMMANDS + * `--cache`: + Display Homebrew's download cache. See also `HOMEBREW_CACHE`. + + * `--cache` [`--build-from-source`|`-s`] [`--force-bottle`] `formula`: + Display the file or directory used to cache `formula`. + + * `--cellar`: + Display Homebrew's Cellar path. *Default:* `$(brew --prefix)/Cellar`, or if + that directory doesn't exist, `$(brew --repository)/Cellar`. + + * `--cellar` `formula`: + Display the location in the cellar where `formula` would be installed, + without any sort of versioned directory as the last path. + + * `--env` [`--shell=`(`shell`|`auto`)|`--plain`]: + Show a summary of the Homebrew build environment as a plain list. + + Pass `--shell=``shell` to generate a list of environment variables for the + specified shell, or `--shell=auto` to detect the current shell. + + If the command's output is sent through a pipe and no shell is specified, + the list is formatted for export to `bash`(1) unless `--plain` is passed. + + * `--prefix`: + Display Homebrew's install path. *Default:* `/usr/local` on macOS and `/home/linuxbrew/.linuxbrew` on Linux + + * `--prefix` `formula`: + Display the location in the cellar where `formula` is or would be installed. + + * `--repository`: + Display where Homebrew's `.git` directory is located. + + * `--repository` `user``/``repo`: + Display where tap `user``/``repo`'s directory is located. + + * `--version`: + Print the version number of Homebrew to standard output and exit. + * `analytics` [`state`]: Display anonymous user behaviour analytics state. Read more at . @@ -441,16 +479,6 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note If `--env=std` is passed, use the standard `PATH` instead of superenv's. - * `shellenv`: - Prints export statements - run them in a shell and this installation of - Homebrew will be included into your PATH, MANPATH, and INFOPATH. - - HOMEBREW_PREFIX, HOMEBREW_CELLAR and HOMEBREW_REPOSITORY are also exported - to save multiple queries of those variables. - - Consider adding evaluating the output in your dotfiles (e.g. `~/.profile`) - with `eval $(brew shellenv)` - * `style` [`--fix`] [`--display-cop-names`] [`--only-cops=``cops`|`--except-cops=``cops`] [`files`|`taps`|`formulae`]: Check formulae or files for conformance to Homebrew style guidelines. @@ -473,6 +501,30 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note * `switch` `formula` `version`: Symlink all of the specific `version` of `formula`'s install to Homebrew prefix. + * `tap-info`: + Display a brief summary of all installed taps. + + * `tap-info` (`--installed`|`taps`): + Display detailed information about one or more `taps`. + + Pass `--installed` to display information on all installed taps. + + * `tap-info` `--json=``version` (`--installed`|`taps`): + Print a JSON representation of `taps`. Currently the only accepted value + for `version` is `v1`. + + Pass `--installed` to get information on installed taps. + + See the docs for examples of using the JSON output: + + + * `tap-pin` `tap`: + Pin `tap`, prioritizing its formulae over core when formula names are supplied + by the user. See also `tap-unpin`. + + * `tap-unpin` `tap`: + Unpin `tap` so its formulae are no longer prioritized. See also `tap-pin`. + * `tap`: List all installed taps. @@ -507,30 +559,6 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note * `tap` `--list-pinned`: List all pinned taps. - * `tap-info`: - Display a brief summary of all installed taps. - - * `tap-info` (`--installed`|`taps`): - Display detailed information about one or more `taps`. - - Pass `--installed` to display information on all installed taps. - - * `tap-info` `--json=``version` (`--installed`|`taps`): - Print a JSON representation of `taps`. Currently the only accepted value - for `version` is `v1`. - - Pass `--installed` to get information on installed taps. - - See the docs for examples of using the JSON output: - - - * `tap-pin` `tap`: - Pin `tap`, prioritizing its formulae over core when formula names are supplied - by the user. See also `tap-unpin`. - - * `tap-unpin` `tap`: - Unpin `tap` so its formulae are no longer prioritized. See also `tap-pin`. - * `uninstall`, `rm`, `remove` [`--force`] [`--ignore-dependencies`] `formula`: Uninstall `formula`. @@ -566,21 +594,6 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note * `untap` `tap`: Remove a tapped repository. - * `update` [`--merge`] [`--force`]: - Fetch the newest version of Homebrew and all formulae from GitHub using - `git`(1) and perform any necessary migrations. - - If `--merge` is specified then `git merge` is used to include updates - (rather than `git rebase`). - - If `--force` (or `-f`) is specified then always do a slower, full update check even - if unnecessary. - - * `update-reset` [`repositories`]: - Fetches and resets Homebrew and all tap repositories (or the specified - `repositories`) using `git`(1) to their latest `origin/master`. Note this - will destroy all your uncommitted or committed changes. - * `upgrade` [`install-options`] [`--cleanup`] [`--fetch-HEAD`] [`--ignore-pinned`] [`--display-times`] [`formulae`]: Upgrade outdated, unpinned brews (with existing install options). @@ -623,296 +636,278 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note cases where `formulae` is used by development or HEAD build, pass `--devel` or `--HEAD`. - * `--cache`: - Display Homebrew's download cache. See also `HOMEBREW_CACHE`. + * `shellenv`: + Prints export statements - run them in a shell and this installation of + Homebrew will be included into your PATH, MANPATH, and INFOPATH. - * `--cache` [`--build-from-source`|`-s`] [`--force-bottle`] `formula`: - Display the file or directory used to cache `formula`. + HOMEBREW_PREFIX, HOMEBREW_CELLAR and HOMEBREW_REPOSITORY are also exported + to save multiple queries of those variables. - * `--cellar`: - Display Homebrew's Cellar path. *Default:* `$(brew --prefix)/Cellar`, or if - that directory doesn't exist, `$(brew --repository)/Cellar`. + Consider adding evaluating the output in your dotfiles (e.g. `~/.profile`) + with `eval $(brew shellenv)` - * `--cellar` `formula`: - Display the location in the cellar where `formula` would be installed, - without any sort of versioned directory as the last path. + * `update-reset` [`repositories`]: + Fetches and resets Homebrew and all tap repositories (or the specified + `repositories`) using `git`(1) to their latest `origin/master`. Note this + will destroy all your uncommitted or committed changes. - * `--env` [`--shell=`(`shell`|`auto`)|`--plain`]: - Show a summary of the Homebrew build environment as a plain list. + * `update` [`--merge`] [`--force`]: + Fetch the newest version of Homebrew and all formulae from GitHub using + `git`(1) and perform any necessary migrations. - Pass `--shell=``shell` to generate a list of environment variables for the - specified shell, or `--shell=auto` to detect the current shell. + If `--merge` is specified then `git merge` is used to include updates + (rather than `git rebase`). - If the command's output is sent through a pipe and no shell is specified, - the list is formatted for export to `bash`(1) unless `--plain` is passed. - - * `--prefix`: - Display Homebrew's install path. *Default:* `/usr/local` on macOS and `/home/linuxbrew/.linuxbrew` on Linux - - * `--prefix` `formula`: - Display the location in the cellar where `formula` is or would be installed. - - * `--repository`: - Display where Homebrew's `.git` directory is located. - - * `--repository` `user``/``repo`: - Display where tap `user``/``repo`'s directory is located. - - * `--version`: - Print the version number of Homebrew to standard output and exit. + If `--force` (or `-f`) is specified then always do a slower, full update check even + if unnecessary. ## DEVELOPER COMMANDS - * `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. +###`audit` [`options`] `formulae`: - If no `formulae` are provided, all of them are checked. +Check `formulae` for Homebrew coding style violations. This should be +run before submitting a new formula. +If no `formulae` are provided, all of them are checked. - If `--strict` is passed, additional checks are run, including RuboCop - style checks. +* `--strict`: +Run additional style checks, including Rubocop style checks. +* `--online`: +Run additional slower style checks that require a network connection. +* `--new-formula`: +Run various additional style checks to determine if a new formula is eligible for Homebrew. This should be used when creating new formula and implies `--strict` and `--online`. +* `--fix`: +Fix style violations automatically using RuboCop's auto-correct feature. +* `--display-cop-names`: +Include the RuboCop cop name for each violation in the output. +* `--display-filename`: +Prefix everyline of output with name of the file or formula being audited, to make output easy to grep. +* `-D`, `--audit-debug`: +Activates debugging and profiling +* `--only`: +Passing `--only`=`method` will run only the methods named audit_`method`, `method` should be a comma-separated list. +* `--except`: +Passing `--except`=`method` will run only the methods named audit_`method`, `method` should be a comma-separated list. +* `--only-cops`: +Passing `--only-cops`=`cops` will check for violations of only the listed RuboCop cops. `cops` should be a comma-separated list of cop names. +* `--except-cops`: +Passing `--except-cops`=`cops` will skip checking the listed RuboCop cops violations. `cops` should be a comma-separated list of cop names. - If `--fix` is passed, style violations will be - automatically fixed using RuboCop's auto-correct feature. +###`bottle` [`options`] `formulae`: - If `--online` is passed, additional slower checks that require a network - connection are run. +Generate a bottle (binary package) from a formula 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. - If `--new-formula` is passed, various additional checks are run that check - if a new formula is eligible for Homebrew. This should be used when creating - new formulae and implies `--strict` and `--online`. +* `--skip-relocation`: +Do not check if the bottle can be marked as relocatable. +* `--or-later`: +Append `_or_later` to the bottle tag. +* `--force-core-tap`: +Build a bottle even if `formula` is not in homebrew/core or any installed taps. +* `--no-rebuild`: +If the formula specifies a rebuild version, it will be removed in the generated DSL. +* `--keep-old`: +If the formula specifies a rebuild version, it will attempted to be kept in the generated DSL. +* `--merge`: +Generate a bottle from a formula and print the new DSL merged into the existing formula. +* `--write`: +Changes will be written to the formula file. A new commit will be generated unless `--no-commit` is passed. +* `--no-commit`: +When passed with `--write`, a new commit will not generated while writing changes to the formula file. +* `--json`: +Write bottle information to a JSON file, which can be used as the argument for `--merge`. +* `--root-url`: +Use the specified `URL` as the root of the bottle's URL instead of Homebrew's default. - If `--display-cop-names` is passed, the RuboCop cop name for each violation - is included in the output. +###`bump-formula-pr` [`options`] `formula`: - 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. +Creates a pull request to update the formula with a new URL or a new tag. - Passing `--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. +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. - Passing `--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. +If a `tag` is specified, the git commit `revision` corresponding to that +tag must also be specified. - `audit` exits with a non-zero status if any errors are found. This is useful, - for instance, for implementing pre-commit hooks. +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. - * `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 - `--build-bottle`. +* `--devel`: +Bump the development rather than stable version. The development spec must already exist. +* `-n`, `--dry-run`: +Print what would be done rather than doing it. +* `--write`: +When passed along with `--dry-run`, perform a not-so-dry run making the expected file modifications but not taking any git actions. +* `--audit`: +Run `brew audit` before opening the PR. +* `--strict`: +Run `brew audit --strict` before opening the PR. +* `--no-browse`: +Output the pull request URL instead of opening in a browser +* `--url`: +Provide new `URL` for the formula. If a `URL` is specified, the `sha-256` checksum of the new download must also be specified. +* `--revision`: +Specify the new git commit `revision` corresponding to a specified `tag`. +* `--tag`: +Specify the new git commit `tag` for the formula. +* `--sha256`: +Specify the `sha-256` checksum of new download. +* `--mirror`: +Use the provided `URL` as a mirror URL. +* `--version`: +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 formula if it has become redundant. +* `--message`: +Append provided `message` to the default PR message. - 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. +###`create` `URL` [`options`]: - If `--verbose` (or `-v`) is passed, print the bottling commands and any warnings - encountered. +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 +. - If `--skip-relocation` is passed, do not check if the bottle can be marked - as relocatable. +* `--autotools`: +Create a basic template for an Autotools-style build. +* `--cmake`: +Create a basic template for a CMake-style build. +* `--meson`: +Create a basic template for a Meson-style build. +* `--no-fetch`: +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). +* `--HEAD`: +HEAD +* `--set-name`: +Set the provided name of the package you are creating. +* `--set-version`: +Set the provided version of the package you are creating. +* `--tap`: +Takes a tap [`user``/``repo`] as argument and generates the formula in the specified tap. - If `--root-url` is passed, use the specified `URL` as the root of the - bottle's URL instead of Homebrew's default. +###`edit` `formula`: + Open `formula` in the editor. Open all of Homebrew for editing if + no `formula` is provided. - 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. +###`extract` [`options`] `formula` `tap` - If `--json` is passed, write bottle information to a JSON file, which can - be used as the argument for `--merge`. +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. - * `bottle` `--merge` [`--keep-old`] [`--write` [`--no-commit`]] `bottle_json_files`: - Generate a bottle from a `--json` output file and print the new DSL merged - into the existing formula. +* `--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. - If `--write` is passed, write the changes to the formula file. A new - commit will then be generated unless `--no-commit` is passed. +###`formula` `formula`: - * `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. +Display the path where `formula` is located. - 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 `tag` is specified, the git commit `revision` corresponding to that - tag must also be specified. +###`irb` [`options`]: - If `--devel` is passed, bump the development rather than stable version. - The development spec must already exist. +Enter the interactive Homebrew Ruby shell. - If `--dry-run` is passed, print what would be done rather than doing it. +* `--examples`: +Show several examples. +* `--pry`: +Pry will be used instead of irb if `--pry` is passed or HOMEBREW_PRY is set. - 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. +###`linkage` [`options`] `formula`: - If `--audit` is passed, run `brew audit` before opening the PR. +Checks the library links of an installed formula. - If `--strict` is passed, run `brew audit --strict` before opening the PR. +Only works on installed formulae. An error is raised if it is run on +uninstalled formulae. - If `--mirror=``URL` is passed, use the value as a mirror URL. +* `--test`: +Display only missing libraries and exit with a non-zero exit code if any missing libraries were found. +* `--reverse`: +Print the dylib followed by the binaries which link to it for each library the keg references. +* `--cached`: +Print the cached linkage values stored in HOMEBREW_CACHE, set from a previous `brew linkage` run. - 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. +###`man` [`options`]: - If `--message=``message` is passed, append `message` to the default PR - message. +Generate Homebrew's manpages. - If `--no-browse` is passed, don't pass the `--browse` argument to `hub` - which opens the pull request URL in a browser. Instead, output it to the - command line. +* `--fail-if-changed`: +Return a failing status code if changes are detected in the manpage outputs. This can be used for CI to be notified when the manpages are out of date. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date). +* `--link`: +It is now done automatically by `brew update`. - If `--quiet` is passed, don't output replacement messages or warn about - duplicate pull requests. +###`mirror` `formulae`: - 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. +Reuploads the stable URL for a formula to Bintray to use it as a mirror. - * `create` `URL` [`--autotools`|`--cmake`|`--meson`] [`--no-fetch`] [`--set-name` `name`] [`--set-version` `version`] [`--tap` `user``/``repo`]: - 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 - . - - 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). - - 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. - - The option `--tap` takes a tap as its argument and generates the formula in - the specified tap. - - * `edit`: - Open all of Homebrew for editing. - - * `edit` `formula`: - Open `formula` in the editor. - - * `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. - - 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. - - * `formula` `formula`: - Display the path where `formula` is located. - - * `irb` [`--examples`] [`--pry`]: - 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. - - * `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. - - If `--test` is passed, only display missing libraries and exit with a - non-zero exit code if any missing libraries were found. - - If `--reverse` is passed, print the dylib followed by the binaries - which link to it for each library the keg references. - - If `formulae` are given, check linkage for only the specified brews. - - * `man` [`--fail-if-changed`]: - Generate Homebrew's manpages. - - If `--fail-if-changed` is passed, the command will return a failing - status code if changes are detected in the manpage outputs. - This can be used for CI to be notified when the manpages are out of date. - Additionally, the date used in new manpages will match those in the existing - manpages (to allow comparison without factoring in the date). * `prof` [`ruby options`]: Run Homebrew with the Ruby profiler. For example: + brew prof readall - * `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`]: +###pull [`options`] `formula`: - Gets a patch from a GitHub commit or pull request and applies it to Homebrew. - Optionally, installs the formulae changed by the patch. +Gets a patch from a GitHub commit or pull request and applies it to Homebrew. +Optionally, installs 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 + ~ The ID number of a PR (pull request) in the homebrew/core GitHub + repository - ~ The URL of a PR on GitHub, using either the web page or API URL - formats. In this form, the PR may be on Homebrew/brew, - Homebrew/homebrew-core or any tap. + ~ The URL of a PR on GitHub, using either the web page or API URL + formats. In this form, the PR may be on Homebrew/brew, + Homebrew/homebrew-core or any tap. - ~ The URL of a commit on GitHub + ~ The URL of a commit on GitHub - ~ A "https://jenkins.brew.sh/job/..." string specifying a testing job ID + ~ A "https://jenkins.brew.sh/job/..." string specifying a testing job ID - If `--bottle` is passed, handle bottles, pulling the bottle-update - commit and publishing files on Bintray. +* `--bottle`: +Handle bottles, pulling the bottle-update commit and publishing files on Bintray. +* `--bump`: +For one-formula PRs, automatically reword commit message to our preferred format. +* `--clean`: +Do not rewrite or otherwise modify the commits found in the pulled PR. +* `--ignore-whitespace`: +Silently ignore whitespace discrepancies when applying diffs. +* `--resolve`: +When a patch fails to apply, leave in progress and allow user to resolve, instead of aborting. +* `--branch-okay`: +Do not warn if pulling to a branch besides master (useful for testing). +* `--no-pbcopy`: +Do not copy anything to the system clipboard. +* `--no-publish`: +Do not publish bottles to Bintray. +* `--warn-on-publish-failure`: +Do not exit if there's a failure publishing bottles on Bintray. +* `--bintray-org`: +Publish at the given Bintray organisation. +* `--test-bot-user`: +Pull the bottle block commit from the specified user on GitHub. - If `--bump` is passed, for one-formula PRs, automatically reword - commit message to our preferred format. +###`release-notes` [`options`] [`previous_tag`] [`end_ref`]: - If `--clean` is passed, do not rewrite or otherwise modify the - commits found in the pulled PR. +Output 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 `--ignore-whitespace` is passed, silently ignore whitespace - discrepancies when applying diffs. - - If `--resolve` is passed, when a patch fails to apply, leave in - progress and allow user to resolve, instead of aborting. - - If `--branch-okay` is passed, do not warn if pulling to a branch - besides master (useful for testing). - - If `--no-pbcopy` is passed, do not copy anything to the system - clipboard. - - If `--no-publish` is passed, do not publish bottles to Bintray. - - 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 - organisation. - - If `--test-bot-user=``test-bot-user` is passed, pull the bottle block - commit from the specified user on GitHub. - - * `release-notes` [`--markdown`] [`previous_tag`] [`end_ref`]: - Output 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. +* `--markdown`: +Output as a Markdown list. * `ruby` [`ruby options`]: Run a Ruby instance with Homebrew's libraries loaded. For example: - * `tap-new` `user``/``repo`: - Generate the template files for a new tap. +###`tap-new` `user`/`repo`: + +Generate the template files for a new tap. + * `test` [`--devel`|`--HEAD`] [`--debug`] [`--keep-tmp`] `formula`: Most formulae provide a test method. `brew test` `formula` runs this @@ -931,38 +926,55 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note Example: `brew install jruby && brew test jruby` - * `tests` [`--verbose`] [`--coverage`] [`--generic`] [`--no-compat`] [`--only=``test_script`[`:``line_number`]] [`--seed=``seed`] [`--online`] [`--official-cmd-taps`]: - 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. +###`tests` [`options`]: - If `--verbose` (or `-v`) is passed, print the command that runs the tests. +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. - If `--coverage` is passed, also generate code coverage reports. +* `--coverage`: +Generate code coverage reports. +* `--generic`: +Run only OS-agnostic tests. +* `--no-compat`: +Do not load the compatibility layer when running tests. +* `--online`: +Include tests that use the GitHub API and tests that use any of the taps for official external commands. +* `--only`: +Run only `test_script`_spec.rb +* `--seed`: +Randomizes tests with the provided value instead of a random seed. - If `--generic` is passed, only run OS-agnostic tests. +###`update-test` [`options`]: - If `--no-compat` is passed, do not load the compatibility layer when - running tests. +Runs a test of `brew update` with a new repository clone. - If `--online` is passed, include tests that use the GitHub API and tests - that use any of the taps for official external commands. +If no arguments are passed, use `origin/master` as the start commit. - * `update-test` [`--commit=``commit`] [`--before=``date`] [`--to-tag`] [`--keep-tmp`]: - Runs a test of `brew update` with a new repository clone. +* `--to-tag`: +Set `HOMEBREW_UPDATE_TO_TAG` to test updating between tags. +* `--keep-tmp`: +Retain the temporary directory containing the new repository clone. +* `--commit`: +Use provided `commit` as the start commit. +* `--before`: +Use the commit at provided `date` as the start commit. - If no arguments are passed, use `origin/master` as the start commit. +## GLOBAL OPTIONS - If `--commit=``commit` is passed, use `commit` as the start commit. +These options are applicable across all sub-commands. - If `--before=``date` is passed, use the commit at `date` as the - start commit. +* `-q`, `--quiet`: +Suppress any warnings. - If `--to-tag` is passed, set `HOMEBREW_UPDATE_TO_TAG` to test updating - between tags. +* `-v`, `--verbose`: +Make some output more verbose. - If `--keep-tmp` is passed, retain the temporary directory containing - the new repository clone. +* `-d`, `--debug`: +Display any debugging information. + +* `-f`, `--force`: +Override warnings and enable potentially unsafe operations. ## OFFICIAL EXTERNAL COMMANDS @@ -1365,6 +1377,7 @@ See our issues on GitHub: [ESSENTIAL COMMANDS]: #ESSENTIAL-COMMANDS "ESSENTIAL COMMANDS" [COMMANDS]: #COMMANDS "COMMANDS" [DEVELOPER COMMANDS]: #DEVELOPER-COMMANDS "DEVELOPER COMMANDS" +[GLOBAL OPTIONS]: #GLOBAL-OPTIONS "GLOBAL OPTIONS" [OFFICIAL EXTERNAL COMMANDS]: #OFFICIAL-EXTERNAL-COMMANDS "OFFICIAL EXTERNAL COMMANDS" [CUSTOM EXTERNAL COMMANDS]: #CUSTOM-EXTERNAL-COMMANDS "CUSTOM EXTERNAL COMMANDS" [SPECIFYING FORMULAE]: #SPECIFYING-FORMULAE "SPECIFYING FORMULAE" diff --git a/manpages/brew-cask.1 b/manpages/brew-cask.1 index 1043b68704..859ad7d1e4 100644 --- a/manpages/brew-cask.1 +++ b/manpages/brew-cask.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BREW\-CASK" "1" "September 2018" "Homebrew" "brew-cask" +.TH "BREW\-CASK" "1" "October 2018" "Homebrew" "brew-cask" . .SH "NAME" \fBbrew\-cask\fR \- a friendly binary installer for macOS diff --git a/manpages/brew.1 b/manpages/brew.1 index 62a643b192..6b543aab3c 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BREW" "1" "September 2018" "Homebrew" "brew" +.TH "BREW" "1" "October 2018" "Homebrew" "brew" . .SH "NAME" \fBbrew\fR \- The missing package manager for macOS @@ -44,6 +44,42 @@ Perform a substring search of formula names for \fItext\fR\. If \fItext\fR is su .SH "COMMANDS" . .IP "\(bu" 4 +\fB\-\-cache\fR: Display Homebrew\'s download cache\. See also \fBHOMEBREW_CACHE\fR\. +. +.IP "\(bu" 4 +\fB\-\-cache\fR [\fB\-\-build\-from\-source\fR|\fB\-s\fR] [\fB\-\-force\-bottle\fR] \fIformula\fR: Display the file or directory used to cache \fIformula\fR\. +. +.IP "\(bu" 4 +\fB\-\-cellar\fR: Display Homebrew\'s Cellar path\. \fIDefault:\fR \fB$(brew \-\-prefix)/Cellar\fR, or if that directory doesn\'t exist, \fB$(brew \-\-repository)/Cellar\fR\. +. +.IP "\(bu" 4 +\fB\-\-cellar\fR \fIformula\fR: Display the location in the cellar where \fIformula\fR would be installed, without any sort of versioned directory as the last path\. +. +.IP "\(bu" 4 +\fB\-\-env\fR [\fB\-\-shell=\fR(\fIshell\fR|\fBauto\fR)|\fB\-\-plain\fR]: Show a summary of the Homebrew build environment as a plain list\. +. +.IP +Pass \fB\-\-shell=\fR\fIshell\fR to generate a list of environment variables for the specified shell, or \fB\-\-shell=auto\fR to detect the current shell\. +. +.IP +If the command\'s output is sent through a pipe and no shell is specified, the list is formatted for export to \fBbash\fR(1) unless \fB\-\-plain\fR is passed\. +. +.IP "\(bu" 4 +\fB\-\-prefix\fR: Display Homebrew\'s install path\. \fIDefault:\fR \fB/usr/local\fR on macOS and \fB/home/linuxbrew/\.linuxbrew\fR on Linux +. +.IP "\(bu" 4 +\fB\-\-prefix\fR \fIformula\fR: Display the location in the cellar where \fIformula\fR is or would be installed\. +. +.IP "\(bu" 4 +\fB\-\-repository\fR: Display where Homebrew\'s \fB\.git\fR directory is located\. +. +.IP "\(bu" 4 +\fB\-\-repository\fR \fIuser\fR\fB/\fR\fIrepo\fR: Display where tap \fIuser\fR\fB/\fR\fIrepo\fR\'s directory is located\. +. +.IP "\(bu" 4 +\fB\-\-version\fR: Print the version number of Homebrew to standard output and exit\. +. +.IP "\(bu" 4 \fBanalytics\fR [\fBstate\fR]: Display anonymous user behaviour analytics state\. Read more at \fIhttps://docs\.brew\.sh/Analytics\fR\. . .IP "\(bu" 4 @@ -404,15 +440,6 @@ If \fB\-\-desc\fR is passed, search formulae with a description matching \fItext If \fB\-\-env=std\fR is passed, use the standard \fBPATH\fR instead of superenv\'s\. . .IP "\(bu" 4 -\fBshellenv\fR: Prints export statements \- run them in a shell and this installation of Homebrew will be included into your PATH, MANPATH, and INFOPATH\. -. -.IP -HOMEBREW_PREFIX, HOMEBREW_CELLAR and HOMEBREW_REPOSITORY are also exported to save multiple queries of those variables\. -. -.IP -Consider adding evaluating the output in your dotfiles (e\.g\. \fB~/\.profile\fR) with \fBeval $(brew shellenv)\fR -. -.IP "\(bu" 4 \fBstyle\fR [\fB\-\-fix\fR] [\fB\-\-display\-cop\-names\fR] [\fB\-\-only\-cops=\fR\fIcops\fR|\fB\-\-except\-cops=\fR\fIcops\fR] [\fIfiles\fR|\fItaps\fR|\fIformulae\fR]: Check formulae or files for conformance to Homebrew style guidelines\. . .IP @@ -434,6 +461,30 @@ Exits with a non\-zero status if any style violations are found\. \fBswitch\fR \fIformula\fR \fIversion\fR: Symlink all of the specific \fIversion\fR of \fIformula\fR\'s install to Homebrew prefix\. . .IP "\(bu" 4 +\fBtap\-info\fR: Display a brief summary of all installed taps\. +. +.IP "\(bu" 4 +\fBtap\-info\fR (\fB\-\-installed\fR|\fItaps\fR): Display detailed information about one or more \fItaps\fR\. +. +.IP +Pass \fB\-\-installed\fR to display information on all installed taps\. +. +.IP "\(bu" 4 +\fBtap\-info\fR \fB\-\-json=\fR\fIversion\fR (\fB\-\-installed\fR|\fItaps\fR): Print a JSON representation of \fItaps\fR\. Currently the only accepted value for \fIversion\fR is \fBv1\fR\. +. +.IP +Pass \fB\-\-installed\fR to get information on installed taps\. +. +.IP +See the docs for examples of using the JSON output: \fIhttps://docs\.brew\.sh/Querying\-Brew\fR +. +.IP "\(bu" 4 +\fBtap\-pin\fR \fItap\fR: Pin \fItap\fR, prioritizing its formulae over core when formula names are supplied by the user\. See also \fBtap\-unpin\fR\. +. +.IP "\(bu" 4 +\fBtap\-unpin\fR \fItap\fR: Unpin \fItap\fR so its formulae are no longer prioritized\. See also \fBtap\-pin\fR\. +. +.IP "\(bu" 4 \fBtap\fR: List all installed taps\. . .IP "\(bu" 4 @@ -461,30 +512,6 @@ By default, only taps hosted on GitHub are auto\-updated (for performance reason \fBtap\fR \fB\-\-list\-pinned\fR: List all pinned taps\. . .IP "\(bu" 4 -\fBtap\-info\fR: Display a brief summary of all installed taps\. -. -.IP "\(bu" 4 -\fBtap\-info\fR (\fB\-\-installed\fR|\fItaps\fR): Display detailed information about one or more \fItaps\fR\. -. -.IP -Pass \fB\-\-installed\fR to display information on all installed taps\. -. -.IP "\(bu" 4 -\fBtap\-info\fR \fB\-\-json=\fR\fIversion\fR (\fB\-\-installed\fR|\fItaps\fR): Print a JSON representation of \fItaps\fR\. Currently the only accepted value for \fIversion\fR is \fBv1\fR\. -. -.IP -Pass \fB\-\-installed\fR to get information on installed taps\. -. -.IP -See the docs for examples of using the JSON output: \fIhttps://docs\.brew\.sh/Querying\-Brew\fR -. -.IP "\(bu" 4 -\fBtap\-pin\fR \fItap\fR: Pin \fItap\fR, prioritizing its formulae over core when formula names are supplied by the user\. See also \fBtap\-unpin\fR\. -. -.IP "\(bu" 4 -\fBtap\-unpin\fR \fItap\fR: Unpin \fItap\fR so its formulae are no longer prioritized\. See also \fBtap\-pin\fR\. -. -.IP "\(bu" 4 \fBuninstall\fR, \fBrm\fR, \fBremove\fR [\fB\-\-force\fR] [\fB\-\-ignore\-dependencies\fR] \fIformula\fR: Uninstall \fIformula\fR\. . .IP @@ -515,18 +542,6 @@ If \fB\-\-git\fR (or \fB\-g\fR) is passed, a Git repository will be initialized \fBuntap\fR \fItap\fR: Remove a tapped repository\. . .IP "\(bu" 4 -\fBupdate\fR [\fB\-\-merge\fR] [\fB\-\-force\fR]: Fetch the newest version of Homebrew and all formulae from GitHub using \fBgit\fR(1) and perform any necessary migrations\. -. -.IP -If \fB\-\-merge\fR is specified then \fBgit merge\fR is used to include updates (rather than \fBgit rebase\fR)\. -. -.IP -If \fB\-\-force\fR (or \fB\-f\fR) is specified then always do a slower, full update check even if unnecessary\. -. -.IP "\(bu" 4 -\fBupdate\-reset\fR [\fIrepositories\fR]: Fetches and resets Homebrew and all tap repositories (or the specified \fBrepositories\fR) using \fBgit\fR(1) to their latest \fBorigin/master\fR\. Note this will destroy all your uncommitted or committed changes\. -. -.IP "\(bu" 4 \fBupgrade\fR [\fIinstall\-options\fR] [\fB\-\-cleanup\fR] [\fB\-\-fetch\-HEAD\fR] [\fB\-\-ignore\-pinned\fR] [\fB\-\-display\-times\fR] [\fIformulae\fR]: Upgrade outdated, unpinned brews (with existing install options)\. . .IP @@ -563,293 +578,353 @@ By default, \fBuses\fR shows all formulae that specify \fIformulae\fR as a requi By default, \fBuses\fR shows usage of \fIformulae\fR by stable builds\. To find cases where \fIformulae\fR is used by development or HEAD build, pass \fB\-\-devel\fR or \fB\-\-HEAD\fR\. . .IP "\(bu" 4 -\fB\-\-cache\fR: Display Homebrew\'s download cache\. See also \fBHOMEBREW_CACHE\fR\. -. -.IP "\(bu" 4 -\fB\-\-cache\fR [\fB\-\-build\-from\-source\fR|\fB\-s\fR] [\fB\-\-force\-bottle\fR] \fIformula\fR: Display the file or directory used to cache \fIformula\fR\. -. -.IP "\(bu" 4 -\fB\-\-cellar\fR: Display Homebrew\'s Cellar path\. \fIDefault:\fR \fB$(brew \-\-prefix)/Cellar\fR, or if that directory doesn\'t exist, \fB$(brew \-\-repository)/Cellar\fR\. -. -.IP "\(bu" 4 -\fB\-\-cellar\fR \fIformula\fR: Display the location in the cellar where \fIformula\fR would be installed, without any sort of versioned directory as the last path\. -. -.IP "\(bu" 4 -\fB\-\-env\fR [\fB\-\-shell=\fR(\fIshell\fR|\fBauto\fR)|\fB\-\-plain\fR]: Show a summary of the Homebrew build environment as a plain list\. +\fBshellenv\fR: Prints export statements \- run them in a shell and this installation of Homebrew will be included into your PATH, MANPATH, and INFOPATH\. . .IP -Pass \fB\-\-shell=\fR\fIshell\fR to generate a list of environment variables for the specified shell, or \fB\-\-shell=auto\fR to detect the current shell\. +HOMEBREW_PREFIX, HOMEBREW_CELLAR and HOMEBREW_REPOSITORY are also exported to save multiple queries of those variables\. . .IP -If the command\'s output is sent through a pipe and no shell is specified, the list is formatted for export to \fBbash\fR(1) unless \fB\-\-plain\fR is passed\. +Consider adding evaluating the output in your dotfiles (e\.g\. \fB~/\.profile\fR) with \fBeval $(brew shellenv)\fR . .IP "\(bu" 4 -\fB\-\-prefix\fR: Display Homebrew\'s install path\. \fIDefault:\fR \fB/usr/local\fR on macOS and \fB/home/linuxbrew/\.linuxbrew\fR on Linux +\fBupdate\-reset\fR [\fIrepositories\fR]: Fetches and resets Homebrew and all tap repositories (or the specified \fBrepositories\fR) using \fBgit\fR(1) to their latest \fBorigin/master\fR\. Note this will destroy all your uncommitted or committed changes\. . .IP "\(bu" 4 -\fB\-\-prefix\fR \fIformula\fR: Display the location in the cellar where \fIformula\fR is or would be installed\. +\fBupdate\fR [\fB\-\-merge\fR] [\fB\-\-force\fR]: Fetch the newest version of Homebrew and all formulae from GitHub using \fBgit\fR(1) and perform any necessary migrations\. . -.IP "\(bu" 4 -\fB\-\-repository\fR: Display where Homebrew\'s \fB\.git\fR directory is located\. +.IP +If \fB\-\-merge\fR is specified then \fBgit merge\fR is used to include updates (rather than \fBgit rebase\fR)\. . -.IP "\(bu" 4 -\fB\-\-repository\fR \fIuser\fR\fB/\fR\fIrepo\fR: Display where tap \fIuser\fR\fB/\fR\fIrepo\fR\'s directory is located\. -. -.IP "\(bu" 4 -\fB\-\-version\fR: Print the version number of Homebrew to standard output and exit\. +.IP +If \fB\-\-force\fR (or \fB\-f\fR) is specified then always do a slower, full update check even if unnecessary\. . .IP "" 0 . .SH "DEVELOPER COMMANDS" . -.TP -\fBaudit\fR [\fB\-\-strict\fR] [\fB\-\-fix\fR] [\fB\-\-online\fR] [\fB\-\-new\-formula\fR] [\fB\-\-display\-cop\-names\fR] [\fB\-\-display\-filename\fR] [\fB\-\-only=\fR\fImethod\fR|\fB\-\-except=\fR\fImethod\fR] [\fB\-\-only\-cops=\fR\fIcops\fR|\fB\-\-except\-cops=\fR\fIcops\fR] [\fIformulae\fR] -Check \fIformulae\fR for Homebrew coding style violations\. This should be run before submitting a new formula\. -. -.IP -If no \fIformulae\fR are provided, all of them are checked\. -. -.IP -If \fB\-\-strict\fR is passed, additional checks are run, including RuboCop style checks\. -. -.IP -If \fB\-\-fix\fR is passed, style violations will be automatically fixed using RuboCop\'s auto\-correct feature\. -. -.IP -If \fB\-\-online\fR is passed, additional slower checks that require a network connection are run\. -. -.IP -If \fB\-\-new\-formula\fR is passed, various additional checks are run that check if a new formula is eligible for Homebrew\. This should be used when creating new formulae and implies \fB\-\-strict\fR and \fB\-\-online\fR\. -. -.IP -If \fB\-\-display\-cop\-names\fR is passed, the RuboCop cop name for each violation is included in the output\. -. -.IP -If \fB\-\-display\-filename\fR 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\. -. -.IP -Passing \fB\-\-only=\fR\fImethod\fR will run only the methods named \fBaudit_\fR, while \fB\-\-except=\fR\fImethod\fR will skip the methods named \fBaudit_\fR\. For either option \fImethod\fR should be a comma\-separated list\. -. -.IP -Passing \fB\-\-only\-cops=\fR\fIcops\fR will check for violations of only the listed RuboCop \fIcops\fR, while \fB\-\-except\-cops=\fR\fIcops\fR will skip checking the listed \fIcops\fR\. For either option \fIcops\fR should be a comma\-separated list of cop names\. -. -.IP -\fBaudit\fR exits with a non\-zero status if any errors are found\. This is useful, for instance, for implementing pre\-commit hooks\. +.SS "\fBaudit\fR [\fIoptions\fR] \fIformulae\fR:" +Check \fIformulae\fR for Homebrew coding style violations\. This should be run before submitting a new formula\. If no \fIformulae\fR are provided, all of them are checked\. . .TP -\fBbottle\fR [\fB\-\-verbose\fR] [\fB\-\-no\-rebuild\fR|\fB\-\-keep\-old\fR] [\fB\-\-skip\-relocation\fR] [\fB\-\-or\-later\fR] [\fB\-\-root\-url=\fR\fIURL\fR] [\fB\-\-force\-core\-tap\fR] [\fB\-\-json\fR] \fIformulae\fR -Generate a bottle (binary package) from a formula installed with \fB\-\-build\-bottle\fR\. -. -.IP -If the formula specifies a rebuild version, it will be incremented in the generated DSL\. Passing \fB\-\-keep\-old\fR will attempt to keep it at its original value, while \fB\-\-no\-rebuild\fR will remove it\. -. -.IP -If \fB\-\-verbose\fR (or \fB\-v\fR) is passed, print the bottling commands and any warnings encountered\. -. -.IP -If \fB\-\-skip\-relocation\fR is passed, do not check if the bottle can be marked as relocatable\. -. -.IP -If \fB\-\-root\-url\fR is passed, use the specified \fIURL\fR as the root of the bottle\'s URL instead of Homebrew\'s default\. -. -.IP -If \fB\-\-or\-later\fR is passed, append _or_later to the bottle tag\. -. -.IP -If \fB\-\-force\-core\-tap\fR is passed, build a bottle even if \fIformula\fR is not in homebrew/core or any installed taps\. -. -.IP -If \fB\-\-json\fR is passed, write bottle information to a JSON file, which can be used as the argument for \fB\-\-merge\fR\. +\fB\-\-strict\fR +Run additional style checks, including Rubocop style checks\. . .TP -\fBbottle\fR \fB\-\-merge\fR [\fB\-\-keep\-old\fR] [\fB\-\-write\fR [\fB\-\-no\-commit\fR]] \fIbottle_json_files\fR -Generate a bottle from a \fB\-\-json\fR output file and print the new DSL merged into the existing formula\. -. -.IP -If \fB\-\-write\fR is passed, write the changes to the formula file\. A new commit will then be generated unless \fB\-\-no\-commit\fR is passed\. +\fB\-\-online\fR +Run additional slower style checks that require a network connection\. . .TP -\fBbump\-formula\-pr\fR [\fB\-\-devel\fR] [\fB\-\-dry\-run\fR [\fB\-\-write\fR]] [\fB\-\-audit\fR|\fB\-\-strict\fR] [\fB\-\-mirror=\fR\fIURL\fR] [\fB\-\-version=\fR\fIversion\fR] [\fB\-\-message=\fR\fImessage\fR] (\fB\-\-url=\fR\fIURL\fR \fB\-\-sha256=\fR\fIsha\-256\fR|\fB\-\-tag=\fR\fItag\fR \fB\-\-revision=\fR\fIrevision\fR) \fIformula\fR +\fB\-\-new\-formula\fR +Run various additional style checks to determine if a new formula is eligible for Homebrew\. This should be used when creating new formula and implies \fB\-\-strict\fR and \fB\-\-online\fR\. +. +.TP +\fB\-\-fix\fR +Fix style violations automatically using RuboCop\'s auto\-correct feature\. +. +.TP +\fB\-\-display\-cop\-names\fR +Include the RuboCop cop name for each violation in the output\. +. +.TP +\fB\-\-display\-filename\fR +Prefix everyline of output with name of the file or formula being audited, to make output easy to grep\. +. +.TP +\fB\-D\fR, \fB\-\-audit\-debug\fR +Activates debugging and profiling +. +.TP +\fB\-\-only\fR +Passing \fB\-\-only\fR=\fImethod\fR will run only the methods named audit_\fImethod\fR, \fBmethod\fR should be a comma\-separated list\. +. +.TP +\fB\-\-except\fR +Passing \fB\-\-except\fR=\fImethod\fR will run only the methods named audit_\fImethod\fR, \fBmethod\fR should be a comma\-separated list\. +. +.TP +\fB\-\-only\-cops\fR +Passing \fB\-\-only\-cops\fR=\fIcops\fR will check for violations of only the listed RuboCop cops\. \fBcops\fR should be a comma\-separated list of cop names\. +. +.TP +\fB\-\-except\-cops\fR +Passing \fB\-\-except\-cops\fR=\fIcops\fR will skip checking the listed RuboCop cops violations\. \fBcops\fR should be a comma\-separated list of cop names\. +. +.SS "\fBbottle\fR [\fIoptions\fR] \fIformulae\fR:" +Generate a bottle (binary package) from a formula installed with \fB\-\-build\-bottle\fR\. If the formula specifies a rebuild version, it will be incremented in the generated DSL\. Passing \fB\-\-keep\-old\fR will attempt to keep it at its original value, while \fB\-\-no\-rebuild\fR will remove it\. +. +.TP +\fB\-\-skip\-relocation\fR +Do not check if the bottle can be marked as relocatable\. +. +.TP +\fB\-\-or\-later\fR +Append \fB_or_later\fR to the bottle tag\. +. +.TP +\fB\-\-force\-core\-tap\fR +Build a bottle even if \fIformula\fR is not in homebrew/core or any installed taps\. +. +.TP +\fB\-\-no\-rebuild\fR +If the formula specifies a rebuild version, it will be removed in the generated DSL\. +. +.TP +\fB\-\-keep\-old\fR +If the formula specifies a rebuild version, it will attempted to be kept in the generated DSL\. +. +.TP +\fB\-\-merge\fR +Generate a bottle from a formula and print the new DSL merged into the existing formula\. +. +.TP +\fB\-\-write\fR +Changes will be written to the formula file\. A new commit will be generated unless \fB\-\-no\-commit\fR is passed\. +. +.TP +\fB\-\-no\-commit\fR +When passed with \fB\-\-write\fR, a new commit will not generated while writing changes to the formula file\. +. +.TP +\fB\-\-json\fR +Write bottle information to a JSON file, which can be used as the argument for \fB\-\-merge\fR\. +. +.TP +\fB\-\-root\-url\fR +Use the specified \fIURL\fR as the root of the bottle\'s URL instead of Homebrew\'s default\. +. +.SS "\fBbump\-formula\-pr\fR [\fIoptions\fR] \fIformula\fR:" Creates a pull request to update the formula with a new URL or a new tag\. . -.IP +.P If a \fIURL\fR is specified, the \fIsha\-256\fR checksum of the new download must also be specified\. A best effort to determine the \fIsha\-256\fR and \fIformula\fR name will be made if either or both values are not supplied by the user\. . -.IP +.P If a \fItag\fR is specified, the git commit \fIrevision\fR corresponding to that tag must also be specified\. . -.IP -If \fB\-\-devel\fR is passed, bump the development rather than stable version\. The development spec must already exist\. -. -.IP -If \fB\-\-dry\-run\fR is passed, print what would be done rather than doing it\. -. -.IP -If \fB\-\-write\fR is passed along with \fB\-\-dry\-run\fR, perform a not\-so\-dry run making the expected file modifications but not taking any git actions\. -. -.IP -If \fB\-\-audit\fR is passed, run \fBbrew audit\fR before opening the PR\. -. -.IP -If \fB\-\-strict\fR is passed, run \fBbrew audit \-\-strict\fR before opening the PR\. -. -.IP -If \fB\-\-mirror=\fR\fIURL\fR is passed, use the value as a mirror URL\. -. -.IP -If \fB\-\-version=\fR\fIversion\fR is passed, use the value to override the value parsed from the URL or tag\. Note that \fB\-\-version=0\fR can be used to delete an existing \fBversion\fR override from a formula if it has become redundant\. -. -.IP -If \fB\-\-message=\fR\fImessage\fR is passed, append \fImessage\fR to the default PR message\. -. -.IP -If \fB\-\-no\-browse\fR is passed, don\'t pass the \fB\-\-browse\fR argument to \fBhub\fR which opens the pull request URL in a browser\. Instead, output it to the command line\. -. -.IP -If \fB\-\-quiet\fR is passed, don\'t output replacement messages or warn about duplicate pull requests\. -. -.IP +.P 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\. . .TP -\fBcreate\fR \fIURL\fR [\fB\-\-autotools\fR|\fB\-\-cmake\fR|\fB\-\-meson\fR] [\fB\-\-no\-fetch\fR] [\fB\-\-set\-name\fR \fIname\fR] [\fB\-\-set\-version\fR \fIversion\fR] [\fB\-\-tap\fR \fIuser\fR\fB/\fR\fIrepo\fR] +\fB\-\-devel\fR +Bump the development rather than stable version\. The development spec must already exist\. +. +.TP +\fB\-n\fR, \fB\-\-dry\-run\fR +Print what would be done rather than doing it\. +. +.TP +\fB\-\-write\fR +When passed along with \fB\-\-dry\-run\fR, perform a not\-so\-dry run making the expected file modifications but not taking any git actions\. +. +.TP +\fB\-\-audit\fR +Run \fBbrew audit\fR before opening the PR\. +. +.TP +\fB\-\-strict\fR +Run \fBbrew audit \-\-strict\fR before opening the PR\. +. +.TP +\fB\-\-no\-browse\fR +Output the pull request URL instead of opening in a browser +. +.TP +\fB\-\-url\fR +Provide new \fIURL\fR for the formula\. If a \fIURL\fR is specified, the \fIsha\-256\fR checksum of the new download must also be specified\. +. +.TP +\fB\-\-revision\fR +Specify the new git commit \fIrevision\fR corresponding to a specified \fItag\fR\. +. +.TP +\fB\-\-tag\fR +Specify the new git commit \fItag\fR for the formula\. +. +.TP +\fB\-\-sha256\fR +Specify the \fIsha\-256\fR checksum of new download\. +. +.TP +\fB\-\-mirror\fR +Use the provided \fIURL\fR as a mirror URL\. +. +.TP +\fB\-\-version\fR +Use the provided \fIversion\fR to override the value parsed from the URL or tag\. Note that \fB\-\-version=0\fR can be used to delete an existing \fBversion\fR override from a formula if it has become redundant\. +. +.TP +\fB\-\-message\fR +Append provided \fImessage\fR to the default PR message\. +. +.SS "\fBcreate\fR \fIURL\fR [\fIoptions\fR]:" Generate a formula for the downloadable file at \fIURL\fR 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 \fBwget\fR formula serves as a simple example\. For the complete API have a look at \fIhttp://www\.rubydoc\.info/github/Homebrew/brew/master/Formula\fR\. . -.IP -If \fB\-\-autotools\fR is passed, create a basic template for an Autotools\-style build\. If \fB\-\-cmake\fR is passed, create a basic template for a CMake\-style build\. If \fB\-\-meson\fR is passed, create a basic template for a Meson\-style build\. -. -.IP -If \fB\-\-no\-fetch\fR is passed, Homebrew will not download \fIURL\fR 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)\. -. -.IP -The options \fB\-\-set\-name\fR and \fB\-\-set\-version\fR each take an argument and allow you to explicitly set the name and version of the package you are creating\. -. -.IP -The option \fB\-\-tap\fR takes a tap as its argument and generates the formula in the specified tap\. +.TP +\fB\-\-autotools\fR +Create a basic template for an Autotools\-style build\. . .TP -\fBedit\fR -Open all of Homebrew for editing\. +\fB\-\-cmake\fR +Create a basic template for a CMake\-style build\. . .TP -\fBedit\fR \fIformula\fR -Open \fIformula\fR in the editor\. +\fB\-\-meson\fR +Create a basic template for a Meson\-style build\. . .TP -\fBextract\fR [\fB\-\-force\fR] \fIformula\fR \fItap\fR [\fB\-\-version=\fR\fIversion\fR] +\fB\-\-no\-fetch\fR +Homebrew will not download \fIURL\fR 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)\. +. +.TP +\fB\-\-HEAD\fR +HEAD +. +.TP +\fB\-\-set\-name\fR +Set the provided name of the package you are creating\. +. +.TP +\fB\-\-set\-version\fR +Set the provided version of the package you are creating\. +. +.TP +\fB\-\-tap\fR +Takes a tap [\fIuser\fR\fB/\fR\fIrepo\fR] as argument and generates the formula in the specified tap\. +. +.SS "\fBedit\fR \fIformula\fR:" +Open \fIformula\fR in the editor\. Open all of Homebrew for editing if no \fIformula\fR is provided\. +. +.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 -\fBformula\fR \fIformula\fR +\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\. . -.TP -\fBirb\fR [\fB\-\-examples\fR] [\fB\-\-pry\fR] +.SS "\fBirb\fR [\fIoptions\fR]:" Enter the interactive Homebrew Ruby shell\. . -.IP -If \fB\-\-examples\fR is passed, several examples will be shown\. If \fB\-\-pry\fR is passed or HOMEBREW_PRY is set, pry will be used instead of irb\. +.TP +\fB\-\-examples\fR +Show several examples\. . .TP -\fBlinkage\fR [\fB\-\-test\fR] [\fB\-\-reverse\fR] [\fIformulae\fR] -Checks the library links of installed formulae\. +\fB\-\-pry\fR +Pry will be used instead of irb if \fB\-\-pry\fR is passed or HOMEBREW_PRY is set\. . -.IP +.SS "\fBlinkage\fR [\fIoptions\fR] \fIformula\fR:" +Checks the library links of an installed formula\. +. +.P Only works on installed formulae\. An error is raised if it is run on uninstalled formulae\. . -.IP -If \fB\-\-test\fR is passed, only display missing libraries and exit with a non\-zero exit code if any missing libraries were found\. -. -.IP -If \fB\-\-reverse\fR is passed, print the dylib followed by the binaries which link to it for each library the keg references\. -. -.IP -If \fIformulae\fR are given, check linkage for only the specified brews\. +.TP +\fB\-\-test\fR +Display only missing libraries and exit with a non\-zero exit code if any missing libraries were found\. . .TP -\fBman\fR [\fB\-\-fail\-if\-changed\fR] +\fB\-\-reverse\fR +Print the dylib followed by the binaries which link to it for each library the keg references\. +. +.TP +\fB\-\-cached\fR +Print the cached linkage values stored in HOMEBREW_CACHE, set from a previous \fBbrew linkage\fR run\. +. +.SS "\fBman\fR [\fIoptions\fR]:" Generate Homebrew\'s manpages\. . -.IP -If \fB\-\-fail\-if\-changed\fR is passed, the command will return a failing status code if changes are detected in the manpage outputs\. This can be used for CI to be notified when the manpages are out of date\. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date)\. +.TP +\fB\-\-fail\-if\-changed\fR +Return a failing status code if changes are detected in the manpage outputs\. This can be used for CI to be notified when the manpages are out of date\. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date)\. +. +.TP +\fB\-\-link\fR +It is now done automatically by \fBbrew update\fR\. +. +.SS "\fBmirror\fR \fIformulae\fR:" +Reuploads the stable URL for a formula to Bintray to use it as a mirror\. . .TP \fBprof\fR [\fIruby options\fR] -Run Homebrew with the Ruby profiler\. For example: +Run Homebrew with the Ruby profiler\. For example: brew prof readall . -.TP -\fBpull\fR [\fB\-\-bottle\fR] [\fB\-\-bump\fR] [\fB\-\-clean\fR] [\fB\-\-ignore\-whitespace\fR] [\fB\-\-resolve\fR] [\fB\-\-branch\-okay\fR] [\fB\-\-no\-pbcopy\fR] [\fB\-\-no\-publish\fR] [\fB\-\-warn\-on\-publish\-failure\fR] [\fB\-\-bintray\-org=\fR\fIbintray\-org\fR] [\fB\-\-test\-bot\-user=\fR\fItest\-bot\-user\fR] \fIpatch\-source\fR [\fIpatch\-source\fR]: -. -.IP +.SS "pull [\fIoptions\fR] \fIformula\fR:" Gets a patch from a GitHub commit or pull request and applies it to Homebrew\. Optionally, installs the formulae changed by the patch\. . -.IP +.P Each \fIpatch\-source\fR may be one of: . -.IP +.P ~ The ID number of a PR (pull request) in the homebrew/core GitHub repository . -.IP +.P ~ The URL of a PR on GitHub, using either the web page or API URL formats\. In this form, the PR may be on Homebrew/brew, Homebrew/homebrew\-core or any tap\. . -.IP +.P ~ The URL of a commit on GitHub . -.IP +.P ~ A "https://jenkins\.brew\.sh/job/\.\.\." string specifying a testing job ID . -.IP -If \fB\-\-bottle\fR is passed, handle bottles, pulling the bottle\-update commit and publishing files on Bintray\. -. -.IP -If \fB\-\-bump\fR is passed, for one\-formula PRs, automatically reword commit message to our preferred format\. -. -.IP -If \fB\-\-clean\fR is passed, do not rewrite or otherwise modify the commits found in the pulled PR\. -. -.IP -If \fB\-\-ignore\-whitespace\fR is passed, silently ignore whitespace discrepancies when applying diffs\. -. -.IP -If \fB\-\-resolve\fR is passed, when a patch fails to apply, leave in progress and allow user to resolve, instead of aborting\. -. -.IP -If \fB\-\-branch\-okay\fR is passed, do not warn if pulling to a branch besides master (useful for testing)\. -. -.IP -If \fB\-\-no\-pbcopy\fR is passed, do not copy anything to the system clipboard\. -. -.IP -If \fB\-\-no\-publish\fR is passed, do not publish bottles to Bintray\. -. -.IP -If \fB\-\-warn\-on\-publish\-failure\fR was passed, do not exit if there\'s a failure publishing bottles on Bintray\. -. -.IP -If \fB\-\-bintray\-org=\fR\fIbintray\-org\fR is passed, publish at the given Bintray organisation\. -. -.IP -If \fB\-\-test\-bot\-user=\fR\fItest\-bot\-user\fR is passed, pull the bottle block commit from the specified user on GitHub\. +.TP +\fB\-\-bottle\fR +Handle bottles, pulling the bottle\-update commit and publishing files on Bintray\. . .TP -\fBrelease\-notes\fR [\fB\-\-markdown\fR] [\fIprevious_tag\fR] [\fIend_ref\fR] +\fB\-\-bump\fR +For one\-formula PRs, automatically reword commit message to our preferred format\. +. +.TP +\fB\-\-clean\fR +Do not rewrite or otherwise modify the commits found in the pulled PR\. +. +.TP +\fB\-\-ignore\-whitespace\fR +Silently ignore whitespace discrepancies when applying diffs\. +. +.TP +\fB\-\-resolve\fR +When a patch fails to apply, leave in progress and allow user to resolve, instead of aborting\. +. +.TP +\fB\-\-branch\-okay\fR +Do not warn if pulling to a branch besides master (useful for testing)\. +. +.TP +\fB\-\-no\-pbcopy\fR +Do not copy anything to the system clipboard\. +. +.TP +\fB\-\-no\-publish\fR +Do not publish bottles to Bintray\. +. +.TP +\fB\-\-warn\-on\-publish\-failure\fR +Do not exit if there\'s a failure publishing bottles on Bintray\. +. +.TP +\fB\-\-bintray\-org\fR +Publish at the given Bintray organisation\. +. +.TP +\fB\-\-test\-bot\-user\fR +Pull the bottle block commit from the specified user on GitHub\. +. +.SS "\fBrelease\-notes\fR [\fIoptions\fR] [\fIprevious_tag\fR] [\fIend_ref\fR]:" Output the merged pull requests on Homebrew/brew between two Git refs\. If no \fIprevious_tag\fR is provided it defaults to the latest tag\. If no \fIend_ref\fR is provided it defaults to \fBorigin/master\fR\. . -.IP -If \fB\-\-markdown\fR is passed, output as a Markdown list\. +.TP +\fB\-\-markdown\fR +Output as a Markdown list\. . .TP \fBruby\fR [\fIruby options\fR] Run a Ruby instance with Homebrew\'s libraries loaded\. For example: . -.TP -\fBtap\-new\fR \fIuser\fR\fB/\fR\fIrepo\fR +.SS "\fBtap\-new\fR \fIuser\fR/\fIrepo\fR:" Generate the template files for a new tap\. . .TP @@ -868,43 +943,73 @@ If \fB\-\-keep\-tmp\fR is passed, the temporary files created for the test are n .IP Example: \fBbrew install jruby && brew test jruby\fR . -.TP -\fBtests\fR [\fB\-\-verbose\fR] [\fB\-\-coverage\fR] [\fB\-\-generic\fR] [\fB\-\-no\-compat\fR] [\fB\-\-only=\fR\fItest_script\fR[\fB:\fR\fIline_number\fR]] [\fB\-\-seed=\fR\fIseed\fR] [\fB\-\-online\fR] [\fB\-\-official\-cmd\-taps\fR] +.SS "\fBtests\fR [\fIoptions\fR]:" Run Homebrew\'s unit and integration tests\. If provided, \fB\-\-only=\fR\fItest_script\fR runs only \fItest_script\fR_spec\.rb, and \fB\-\-seed\fR randomizes tests with the provided value instead of a random seed\. . -.IP -If \fB\-\-verbose\fR (or \fB\-v\fR) is passed, print the command that runs the tests\. -. -.IP -If \fB\-\-coverage\fR is passed, also generate code coverage reports\. -. -.IP -If \fB\-\-generic\fR is passed, only run OS\-agnostic tests\. -. -.IP -If \fB\-\-no\-compat\fR is passed, do not load the compatibility layer when running tests\. -. -.IP -If \fB\-\-online\fR is passed, include tests that use the GitHub API and tests that use any of the taps for official external commands\. +.TP +\fB\-\-coverage\fR +Generate code coverage reports\. . .TP -\fBupdate\-test\fR [\fB\-\-commit=\fR\fIcommit\fR] [\fB\-\-before=\fR\fIdate\fR] [\fB\-\-to\-tag\fR] [\fB\-\-keep\-tmp\fR] +\fB\-\-generic\fR +Run only OS\-agnostic tests\. +. +.TP +\fB\-\-no\-compat\fR +Do not load the compatibility layer when running tests\. +. +.TP +\fB\-\-online\fR +Include tests that use the GitHub API and tests that use any of the taps for official external commands\. +. +.TP +\fB\-\-only\fR +Run only \fItest_script\fR_spec\.rb +. +.TP +\fB\-\-seed\fR +Randomizes tests with the provided value instead of a random seed\. +. +.SS "\fBupdate\-test\fR [\fIoptions\fR]:" Runs a test of \fBbrew update\fR with a new repository clone\. . -.IP +.P If no arguments are passed, use \fBorigin/master\fR as the start commit\. . -.IP -If \fB\-\-commit=\fR\fIcommit\fR is passed, use \fIcommit\fR as the start commit\. +.TP +\fB\-\-to\-tag\fR +Set \fBHOMEBREW_UPDATE_TO_TAG\fR to test updating between tags\. . -.IP -If \fB\-\-before=\fR\fIdate\fR is passed, use the commit at \fIdate\fR as the start commit\. +.TP +\fB\-\-keep\-tmp\fR +Retain the temporary directory containing the new repository clone\. . -.IP -If \fB\-\-to\-tag\fR is passed, set \fBHOMEBREW_UPDATE_TO_TAG\fR to test updating between tags\. +.TP +\fB\-\-commit\fR +Use provided \fIcommit\fR as the start commit\. . -.IP -If \fB\-\-keep\-tmp\fR is passed, retain the temporary directory containing the new repository clone\. +.TP +\fB\-\-before\fR +Use the commit at provided \fIdate\fR as the start commit\. +. +.SH "GLOBAL OPTIONS" +These options are applicable across all sub\-commands\. +. +.TP +\fB\-q\fR, \fB\-\-quiet\fR +Suppress any warnings\. +. +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Make some output more verbose\. +. +.TP +\fB\-d\fR, \fB\-\-debug\fR +Display any debugging information\. +. +.TP +\fB\-f\fR, \fB\-\-force\fR +Override warnings and enable potentially unsafe operations\. . .SH "OFFICIAL EXTERNAL COMMANDS" .