From 22c2b06fa583f3ebaf33f6cbb7055e6b1dbc2cd0 Mon Sep 17 00:00:00 2001 From: Gautham Goli Date: Tue, 29 Jan 2019 19:52:06 +0530 Subject: [PATCH 1/3] cmd/upgrade: Use CLI::Parser to parse args --- Library/Homebrew/cmd/upgrade.rb | 47 ++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 7a9fad981c..68ab9f7c81 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -23,10 +23,37 @@ require "formula_installer" require "development_tools" require "messages" require "cleanup" +require "cli_parser" module Homebrew module_function + def upgrade_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `upgrade` [] [] [] + + Upgrade outdated, unpinned brews (with existing install options). + Options for the `install` command are also valid here. + + If are given, upgrade only the specified brews (unless they + are pinned; see `pin`, `unpin`). + EOS + switch "--fetch-HEAD", + description: "Fetch the upstream repository to detect if the HEAD installation of the "\ + "formula is outdated. Otherwise, the repository's HEAD will be checked for "\ + "updates when a new stable or devel version has been released." + switch "--ignore-pinned", + description: "Set a 0 exit code even if pinned formulae are not upgraded." + switch "--build-bottle", + description: "Prepare the formula for eventual bottling during installation." + switch "--display-times", + description: "Print install times for each formula at the end of the run." + switch :verbose + switch :debug + end + end + def upgrade if ARGV.include?("--cleanup") odisabled("'brew upgrade --cleanup'") @@ -40,13 +67,13 @@ module Homebrew if ARGV.named.empty? outdated = Formula.installed.select do |f| - f.outdated?(fetch_head: ARGV.fetch_head?) + f.outdated?(fetch_head: args.fetch_HEAD?) end exit 0 if outdated.empty? else outdated = ARGV.resolved_formulae.select do |f| - f.outdated?(fetch_head: ARGV.fetch_head?) + f.outdated?(fetch_head: args.fetch_HEAD?) end (ARGV.resolved_formulae - outdated).each do |f| @@ -65,7 +92,7 @@ module Homebrew outdated -= pinned formulae_to_install = outdated.map(&:latest_formula) - if !pinned.empty? && !ARGV.include?("--ignore-pinned") + if !pinned.empty? && !args.ignore_pinned? ofail "Not upgrading #{pinned.count} pinned #{"package".pluralize(pinned.count)}:" puts pinned.map { |f| "#{f.full_specified_name} #{f.pkg_version}" } * ", " end @@ -144,7 +171,7 @@ module Homebrew fi = FormulaInstaller.new(f) fi.options = options - fi.build_bottle = ARGV.build_bottle? || (!f.bottle_defined? && f.build.bottle?) + fi.build_bottle = args.build_bottle? || (!f.bottle_defined? && f.build.bottle?) fi.installed_on_request = !ARGV.named.empty? fi.link_keg ||= keg_was_linked if keg_had_linked_opt if tab @@ -203,7 +230,7 @@ module Homebrew next if formulae_to_upgrade.include?(f) next if formulae_pinned.include?(f) - if f.outdated?(fetch_head: ARGV.fetch_head?) + if f.outdated?(fetch_head: args.fetch_HEAD?) if f.pinned? formulae_pinned << f else @@ -247,7 +274,7 @@ module Homebrew checker = LinkageChecker.new(keg, cache_db: db) if checker.broken_library_linkage? - if f.outdated?(fetch_head: ARGV.fetch_head?) + if f.outdated?(fetch_head: args.fetch_HEAD?) # Outdated formulae = pinned formulae (see function above) formulae_pinned_and_outdated << f else @@ -295,7 +322,7 @@ module Homebrew return if kegs.empty? - oh1 "Checking dependents for outdated formulae" if ARGV.verbose? + oh1 "Checking dependents for outdated formulae" if args.verbose? upgradable, pinned = upgradable_dependents(kegs, formulae).map(&:to_a) upgradable.sort! { |a, b| depends_on(a, b) } @@ -310,7 +337,7 @@ module Homebrew # Print the upgradable dependents. if upgradable.empty? - ohai "No dependents to upgrade" if ARGV.verbose? + ohai "No dependents to upgrade" if args.verbose? else ohai "Upgrading #{upgradable.count} #{"dependent".pluralize(upgradable.count)}:" formulae_upgrades = upgradable.map do |f| @@ -328,7 +355,7 @@ module Homebrew # Assess the dependents tree again. kegs = formulae_with_runtime_dependencies - oh1 "Checking dependents for broken library links" if ARGV.verbose? + oh1 "Checking dependents for broken library links" if args.verbose? reinstallable, pinned = broken_dependents(kegs, formulae).map(&:to_a) reinstallable.sort! { |a, b| depends_on(a, b) } @@ -343,7 +370,7 @@ module Homebrew # Print the broken dependents. if reinstallable.empty? - ohai "No broken dependents to reinstall" if ARGV.verbose? + ohai "No broken dependents to reinstall" if args.verbose? else ohai "Reinstalling #{reinstallable.count} broken #{"dependent".pluralize(reinstallable.count)} from source:" puts reinstallable.map(&:full_specified_name).join(", ") From 9eabcdad7d9633069bd412d86a1283d642d21571 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 29 Jan 2019 19:25:13 +0000 Subject: [PATCH 2/3] Make install/reinstall/upgrade options more consistent. --- Library/Homebrew/cli_parser.rb | 15 ++++++ Library/Homebrew/cmd/install.rb | 20 ++----- Library/Homebrew/cmd/reinstall.rb | 48 ++++++++++++++--- Library/Homebrew/cmd/upgrade.rb | 57 +++++++++++++++----- Library/Homebrew/test/cmd/reinstall_spec.rb | 5 +- docs/Manpage.md | 58 ++++++++++++++++++--- manpages/brew.1 | 53 ++++++++++++++++--- 7 files changed, 203 insertions(+), 53 deletions(-) diff --git a/Library/Homebrew/cli_parser.rb b/Library/Homebrew/cli_parser.rb index da63133dfb..1fa11a1d47 100644 --- a/Library/Homebrew/cli_parser.rb +++ b/Library/Homebrew/cli_parser.rb @@ -148,6 +148,21 @@ module Homebrew .gsub(/\*(.*?)\*/m, "#{Tty.underline}\\1#{Tty.reset}") end + def formula_options + ARGV.formulae.each do |f| + next if f.options.empty? + f.options.each do |o| + name = o.flag + description = "`#{f.name}`: #{o.description}" + if name.end_with? "=" + flag name, description: description + else + switch name, description: description + end + end + end + end + private def enable_switch(*names) diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 3870330617..46b4820f90 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -41,7 +41,7 @@ #: If `--devel` is passed, and defines it, install the development version. #: #: If `--HEAD` is passed, and defines it, install the HEAD version, -#: aka master, trunk, unstable. +#: aka. master, trunk, unstable. #: #: If `--keep-tmp` is passed, the temporary files created during installation #: are not deleted. @@ -85,7 +85,7 @@ module Homebrew def install_args Homebrew::CLI::Parser.new do usage_banner <<~EOS - `install` [] formula + `install` [] Install . @@ -124,7 +124,7 @@ module Homebrew switch "--devel", description: "If defines it, install the development version." switch "--HEAD", - description: "If defines it, install the HEAD version, aka master, trunk, unstable." + description: "If defines it, install the HEAD version, aka. master, trunk, unstable." switch "--fetch-HEAD", description: "Fetch the upstream repository to detect if the HEAD installation of the "\ "formula is outdated. Otherwise, the repository's HEAD will be checked for "\ @@ -146,19 +146,7 @@ module Homebrew "package into a Homebrew package." switch "-g", "--git", description: "Create a Git repository, useful for creating patches to the software." - - ARGV.formulae.each do |f| - next if f.options.empty? - f.options.each do |o| - name = o.flag - description = "`#{f.name}`: #{o.description}" - if name.end_with? "=" - flag name, description: description - else - switch name, description: description - end - end - end + formula_options end end diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index 123e97d7ab..0b0abe0a7d 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -1,8 +1,30 @@ -#: * `reinstall` [`--display-times`] : -#: Uninstall and then install (with existing install options). +#: * `reinstall` [`--debug`] [`--build-from-source`|`--force-bottle`] [`--keep-tmp`] [`--force`] [`--verbose`] [`--display-times`] : +#: Uninstall and then install (with existing and any appended install options). +#: +#: If `--debug` (or `-d`) is passed and brewing fails, open an interactive debugging +#: session with access to IRB or a shell inside the temporary build directory. +#: +#: If `--build-from-source` (or `-s`) is passed, compile the specified from +#: source even if a bottle is provided. Dependencies will still be installed +#: from bottles if they are available. +#: +#: If `--force-bottle` is passed, install from a bottle if it exists for the +#: current or newest version of macOS, even if it would not normally be used +#: for installation. +#: +#: If `--keep-tmp` is passed, the temporary files created during installation +#: are not deleted. +#: +#: If `--force` (or `-f`) is passed, install without checking for previously +#: installed keg-only or non-migrated versions +#: +#: If `--verbose` (or `-v`) is passed, print the verification and postinstall steps. #: #: If `--display-times` is passed, install times for each formula are printed #: at the end of the run. +#: +#: Installation options specific to may be appended to the command, +#: and can be listed with `brew options` . require "formula_installer" require "development_tools" @@ -17,16 +39,28 @@ module Homebrew def reinstall_args Homebrew::CLI::Parser.new do usage_banner <<~EOS - `reinstall` [] : + `reinstall` [] - Uninstall and then install (with existing install options). + Uninstall and then install (with existing and any appended install options). EOS + switch :debug, + description: "If brewing fails, open an interactive debugging session with access to IRB "\ + "or a shell inside the temporary build directory" switch "-s", "--build-from-source", - description: "Compile the formula> from source even if a bottle is available." + description: "Compile from source even if a bottle is available." + switch "--force-bottle", + description: "Install from a bottle if it exists for the current or newest version of "\ + "macOS, even if it would not normally be used for installation." + switch "--keep-tmp", + description: "Dont delete the temporary files created during installation." + switch :force, + description: "Install without checking for previously installed keg-only or "\ + "non-migrated versions." + switch :verbose, + description: "Print the verification and postinstall steps." switch "--display-times", description: "Print install times for each formula at the end of the run." - switch :verbose - switch :debug + formula_options end end diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 68ab9f7c81..798a7e6418 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -1,7 +1,19 @@ -#: * `upgrade` [] [`--fetch-HEAD`] [`--ignore-pinned`] [`--display-times`] []: -#: Upgrade outdated, unpinned brews (with existing install options). +#: * `upgrade` [`--debug`] [`--build-from-source`|`--force-bottle`] [`--fetch-HEAD`] [`--ignore-pinned`] [`--keep-tmp`] [`--force`] [`--verbose`] [`--display-times`] [] [ ...]: +#: Upgrade outdated, unpinned brews (with existing and any appended install options). #: -#: Options for the `install` command are also valid here. +#: If are given, upgrade only the specified brews (unless they +#: are pinned; see `pin`, `unpin`). +#: +#: If `--debug` (or `-d`) is passed and brewing fails, open an interactive debugging +#: session with access to IRB or a shell inside the temporary build directory. +#: +#: If `--build-from-source` (or `-s`) is passed, compile the specified from +#: source even if a bottle is provided. Dependencies will still be installed +#: from bottles if they are available. +#: +#: If `--force-bottle` is passed, install from a bottle if it exists for the +#: current or newest version of macOS, even if it would not normally be used +#: for installation. #: #: If `--fetch-HEAD` is passed, fetch the upstream repository to detect if #: the HEAD installation of the formula is outdated. Otherwise, the @@ -11,11 +23,19 @@ #: If `--ignore-pinned` is passed, set a 0 exit code even if pinned formulae #: are not upgraded. #: +#: If `--keep-tmp` is passed, the temporary files created during installation +#: are not deleted. +#: +#: If `--force` (or `-f`) is passed, install without checking for previously +#: installed keg-only or non-migrated versions +#: +#: If `--verbose` (or `-v`) is passed, print the verification and postinstall steps. +#: #: If `--display-times` is passed, install times for each formula are printed #: at the end of the run. #: -#: If are given, upgrade only the specified brews (unless they -#: are pinned; see `pin`, `unpin`). +#: Additional options specific to may be appended to the command, +#: and can be listed with `brew options` . require "install" require "reinstall" @@ -31,26 +51,37 @@ module Homebrew def upgrade_args Homebrew::CLI::Parser.new do usage_banner <<~EOS - `upgrade` [] [] [] + `upgrade` [] - Upgrade outdated, unpinned brews (with existing install options). - Options for the `install` command are also valid here. + Upgrade outdated, unpinned brews (with existing and any appended install options). - If are given, upgrade only the specified brews (unless they + If are given, upgrade only the specified brews (unless they are pinned; see `pin`, `unpin`). EOS + switch :debug, + description: "If brewing fails, open an interactive debugging session with access to IRB "\ + "or a shell inside the temporary build directory" + switch "-s", "--build-from-source", + description: "Compile from source even if a bottle is available." + switch "--force-bottle", + description: "Install from a bottle if it exists for the current or newest version of "\ + "macOS, even if it would not normally be used for installation." switch "--fetch-HEAD", description: "Fetch the upstream repository to detect if the HEAD installation of the "\ "formula is outdated. Otherwise, the repository's HEAD will be checked for "\ "updates when a new stable or devel version has been released." switch "--ignore-pinned", description: "Set a 0 exit code even if pinned formulae are not upgraded." - switch "--build-bottle", - description: "Prepare the formula for eventual bottling during installation." + switch "--keep-tmp", + description: "Dont delete the temporary files created during installation." + switch :force, + description: "Install without checking for previously installed keg-only or "\ + "non-migrated versions." + switch :verbose, + description: "Print the verification and postinstall steps." switch "--display-times", description: "Print install times for each formula at the end of the run." - switch :verbose - switch :debug + formula_options end end diff --git a/Library/Homebrew/test/cmd/reinstall_spec.rb b/Library/Homebrew/test/cmd/reinstall_spec.rb index ab64d5e0cf..178a0588d4 100644 --- a/Library/Homebrew/test/cmd/reinstall_spec.rb +++ b/Library/Homebrew/test/cmd/reinstall_spec.rb @@ -21,8 +21,9 @@ describe "brew reinstall", :integration_test do end it "reinstalls a Formula even when one of the options is invalid" do - expect { brew "reinstall", "testball", "--with-fo" } - .to output(/Error: invalid option: --with-fo/).to_stderr + expect { brew "reinstall", "testball", "--invalid" } + .to output(/Error: invalid option: --invalid/).to_stderr + .and not_to_output.to_stdout .and be_a_failure end diff --git a/docs/Manpage.md b/docs/Manpage.md index 553a347314..c7e86cb8a7 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -279,7 +279,7 @@ these flags should only appear after a command. If `--devel` is passed, and *`formula`* defines it, install the development version. If `--HEAD` is passed, and *`formula`* defines it, install the HEAD version, - aka master, trunk, unstable. + aka. master, trunk, unstable. If `--keep-tmp` is passed, the temporary files created during installation are not deleted. @@ -414,12 +414,34 @@ these flags should only appear after a command. If `--syntax` is passed, also syntax-check all of Homebrew's Ruby files. - * `reinstall` [`--display-times`] *`formula`*: - Uninstall and then install *`formula`* (with existing install options). + * `reinstall` [`--debug`] [`--build-from-source`|`--force-bottle`] [`--keep-tmp`] [`--force`] [`--verbose`] [`--display-times`] *`formula`*: + Uninstall and then install *`formula`* (with existing and any appended install options). + + If `--debug` (or `-d`) is passed and brewing fails, open an interactive debugging + session with access to IRB or a shell inside the temporary build directory. + + If `--build-from-source` (or `-s`) is passed, compile the specified *`formula`* from + source even if a bottle is provided. Dependencies will still be installed + from bottles if they are available. + + If `--force-bottle` is passed, install from a bottle if it exists for the + current or newest version of macOS, even if it would not normally be used + for installation. + + If `--keep-tmp` is passed, the temporary files created during installation + are not deleted. + + If `--force` (or `-f`) is passed, install without checking for previously + installed keg-only or non-migrated versions + + If `--verbose` (or `-v`) is passed, print the verification and postinstall steps. If `--display-times` is passed, install times for each formula are printed at the end of the run. + Installation options specific to *`formula`* may be appended to the command, + and can be listed with `brew options` *`formula`*. + * `search`, `-S`: Display all locally available formulae (including tapped ones). No online search is performed. @@ -588,10 +610,22 @@ these flags should only appear after a command. `repositories`) using `git`(1) to their latest `origin/master`. Note this will destroy all your uncommitted or committed changes. - * `upgrade` [*`install-options`*] [`--fetch-HEAD`] [`--ignore-pinned`] [`--display-times`] [*`formulae`*]: - Upgrade outdated, unpinned brews (with existing install options). + * `upgrade` [`--debug`] [`--build-from-source`|`--force-bottle`] [`--fetch-HEAD`] [`--ignore-pinned`] [`--keep-tmp`] [`--force`] [`--verbose`] [`--display-times`] [*`formula`*] [*`options`* ...]: + Upgrade outdated, unpinned brews (with existing and any appended install options). - Options for the `install` command are also valid here. + If *`formula`* are given, upgrade only the specified brews (unless they + are pinned; see `pin`, `unpin`). + + If `--debug` (or `-d`) is passed and brewing fails, open an interactive debugging + session with access to IRB or a shell inside the temporary build directory. + + If `--build-from-source` (or `-s`) is passed, compile the specified *`formula`* from + source even if a bottle is provided. Dependencies will still be installed + from bottles if they are available. + + If `--force-bottle` is passed, install from a bottle if it exists for the + current or newest version of macOS, even if it would not normally be used + for installation. If `--fetch-HEAD` is passed, fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the @@ -601,11 +635,19 @@ these flags should only appear after a command. If `--ignore-pinned` is passed, set a 0 exit code even if pinned formulae are not upgraded. + If `--keep-tmp` is passed, the temporary files created during installation + are not deleted. + + If `--force` (or `-f`) is passed, install without checking for previously + installed keg-only or non-migrated versions + + If `--verbose` (or `-v`) is passed, print the verification and postinstall steps. + If `--display-times` is passed, install times for each formula are printed at the end of the run. - If *`formulae`* are given, upgrade only the specified brews (unless they - are pinned; see `pin`, `unpin`). + Additional options specific to *`formula`* may be appended to the command, + and can be listed with `brew options` *`formula`*. * `uses` [`--installed`] [`--recursive`] [`--include-build`] [`--include-test`] [`--include-optional`] [`--skip-recommended`] [`--devel`|`--HEAD`] *`formulae`*: Show the formulae that specify *`formulae`* as a dependency. When given diff --git a/manpages/brew.1 b/manpages/brew.1 index 74f920374a..00fcb0a118 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -285,7 +285,7 @@ If \fB\-\-include\-test\fR is passed, install testing dependencies\. These are o If \fB\-\-devel\fR is passed, and \fIformula\fR defines it, install the development version\. . .IP -If \fB\-\-HEAD\fR is passed, and \fIformula\fR defines it, install the HEAD version, aka master, trunk, unstable\. +If \fB\-\-HEAD\fR is passed, and \fIformula\fR defines it, install the HEAD version, aka\. master, trunk, unstable\. . .IP If \fB\-\-keep\-tmp\fR is passed, the temporary files created during installation are not deleted\. @@ -426,12 +426,33 @@ If \fB\-\-aliases\fR is passed, also verify any alias symlinks in each tap\. If \fB\-\-syntax\fR is passed, also syntax\-check all of Homebrew\'s Ruby files\. . .TP -\fBreinstall\fR [\fB\-\-display\-times\fR] \fIformula\fR -Uninstall and then install \fIformula\fR (with existing install options)\. +\fBreinstall\fR [\fB\-\-debug\fR] [\fB\-\-build\-from\-source\fR|\fB\-\-force\-bottle\fR] [\fB\-\-keep\-tmp\fR] [\fB\-\-force\fR] [\fB\-\-verbose\fR] [\fB\-\-display\-times\fR] \fIformula\fR +Uninstall and then install \fIformula\fR (with existing and any appended install options)\. +. +.IP +If \fB\-\-debug\fR (or \fB\-d\fR) is passed and brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory\. +. +.IP +If \fB\-\-build\-from\-source\fR (or \fB\-s\fR) is passed, compile the specified \fIformula\fR from source even if a bottle is provided\. Dependencies will still be installed from bottles if they are available\. +. +.IP +If \fB\-\-force\-bottle\fR is passed, install from a bottle if it exists for the current or newest version of macOS, even if it would not normally be used for installation\. +. +.IP +If \fB\-\-keep\-tmp\fR is passed, the temporary files created during installation are not deleted\. +. +.IP +If \fB\-\-force\fR (or \fB\-f\fR) is passed, install without checking for previously installed keg\-only or non\-migrated versions +. +.IP +If \fB\-\-verbose\fR (or \fB\-v\fR) is passed, print the verification and postinstall steps\. . .IP If \fB\-\-display\-times\fR is passed, install times for each formula are printed at the end of the run\. . +.IP +Installation options specific to \fIformula\fR may be appended to the command, and can be listed with \fBbrew options\fR \fIformula\fR\. +. .TP \fBsearch\fR, \fB\-S\fR Display all locally available formulae (including tapped ones)\. No online search is performed\. @@ -601,11 +622,20 @@ If \fB\-\-force\fR (or \fB\-f\fR) is specified then always do a slower, full upd 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\. . .TP -\fBupgrade\fR [\fIinstall\-options\fR] [\fB\-\-fetch\-HEAD\fR] [\fB\-\-ignore\-pinned\fR] [\fB\-\-display\-times\fR] [\fIformulae\fR] -Upgrade outdated, unpinned brews (with existing install options)\. +\fBupgrade\fR [\fB\-\-debug\fR] [\fB\-\-build\-from\-source\fR|\fB\-\-force\-bottle\fR] [\fB\-\-fetch\-HEAD\fR] [\fB\-\-ignore\-pinned\fR] [\fB\-\-keep\-tmp\fR] [\fB\-\-force\fR] [\fB\-\-verbose\fR] [\fB\-\-display\-times\fR] [\fIformula\fR] [\fIoptions\fR \.\.\.] +Upgrade outdated, unpinned brews (with existing and any appended install options)\. . .IP -Options for the \fBinstall\fR command are also valid here\. +If \fIformula\fR are given, upgrade only the specified brews (unless they are pinned; see \fBpin\fR, \fBunpin\fR)\. +. +.IP +If \fB\-\-debug\fR (or \fB\-d\fR) is passed and brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory\. +. +.IP +If \fB\-\-build\-from\-source\fR (or \fB\-s\fR) is passed, compile the specified \fIformula\fR from source even if a bottle is provided\. Dependencies will still be installed from bottles if they are available\. +. +.IP +If \fB\-\-force\-bottle\fR is passed, install from a bottle if it exists for the current or newest version of macOS, even if it would not normally be used for installation\. . .IP If \fB\-\-fetch\-HEAD\fR is passed, fetch the upstream repository to detect if the HEAD installation of the formula is outdated\. Otherwise, the repository\'s HEAD will be checked for updates when a new stable or devel version has been released\. @@ -614,10 +644,19 @@ If \fB\-\-fetch\-HEAD\fR is passed, fetch the upstream repository to detect if t If \fB\-\-ignore\-pinned\fR is passed, set a 0 exit code even if pinned formulae are not upgraded\. . .IP +If \fB\-\-keep\-tmp\fR is passed, the temporary files created during installation are not deleted\. +. +.IP +If \fB\-\-force\fR (or \fB\-f\fR) is passed, install without checking for previously installed keg\-only or non\-migrated versions +. +.IP +If \fB\-\-verbose\fR (or \fB\-v\fR) is passed, print the verification and postinstall steps\. +. +.IP If \fB\-\-display\-times\fR is passed, install times for each formula are printed at the end of the run\. . .IP -If \fIformulae\fR are given, upgrade only the specified brews (unless they are pinned; see \fBpin\fR, \fBunpin\fR)\. +Additional options specific to \fIformula\fR may be appended to the command, and can be listed with \fBbrew options\fR \fIformula\fR\. . .TP \fBuses\fR [\fB\-\-installed\fR] [\fB\-\-recursive\fR] [\fB\-\-include\-build\fR] [\fB\-\-include\-test\fR] [\fB\-\-include\-optional\fR] [\fB\-\-skip\-recommended\fR] [\fB\-\-devel\fR|\fB\-\-HEAD\fR] \fIformulae\fR From 867b155479be4a50e02580e05df770aec84438be Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 29 Jan 2019 19:39:41 +0000 Subject: [PATCH 3/3] Add missing conflicts to command options. --- Library/Homebrew/cmd/deps.rb | 1 + Library/Homebrew/cmd/desc.rb | 1 + Library/Homebrew/cmd/fetch.rb | 2 ++ Library/Homebrew/cmd/info.rb | 1 + Library/Homebrew/cmd/install.rb | 3 +++ Library/Homebrew/cmd/options.rb | 1 + Library/Homebrew/cmd/outdated.rb | 1 + Library/Homebrew/cmd/reinstall.rb | 1 + Library/Homebrew/cmd/unpack.rb | 1 + Library/Homebrew/cmd/upgrade.rb | 1 + Library/Homebrew/cmd/uses.rb | 1 + Library/Homebrew/dev-cmd/bump-formula-pr.rb | 1 + Library/Homebrew/dev-cmd/create.rb | 1 + Library/Homebrew/dev-cmd/test.rb | 1 + 14 files changed, 17 insertions(+) diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index b2f038c286..dd51f8913b 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -98,6 +98,7 @@ module Homebrew "debugging the `--installed`/`--all` display mode." switch :verbose switch :debug + conflicts "--installed", "--all" end end diff --git a/Library/Homebrew/cmd/desc.rb b/Library/Homebrew/cmd/desc.rb index 2ce5514fc4..5e9c972272 100644 --- a/Library/Homebrew/cmd/desc.rb +++ b/Library/Homebrew/cmd/desc.rb @@ -37,6 +37,7 @@ module Homebrew description: "Search just the descriptions for provided . If is flanked by slashes, "\ "it is interpreted as a regular expression." switch :verbose + conflicts "--search=", "--name=", "--description=" end end diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index 3b870b3640..84a8e2bc24 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -60,6 +60,8 @@ module Homebrew "even if it would not be used during installation." switch :verbose switch :debug + conflicts "--devel", "--HEAD" + conflicts "--build-from-source", "--build-bottle", "--force-bottle" end end diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index ce72549531..3693a6cba9 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -79,6 +79,7 @@ module Homebrew switch :verbose, description: "See more verbose analytics data." switch :debug + conflicts "--all", "--installed" end end diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 46b4820f90..46a4bef490 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -146,6 +146,9 @@ module Homebrew "package into a Homebrew package." switch "-g", "--git", description: "Create a Git repository, useful for creating patches to the software." + conflicts "--ignore-dependencies", "--only-dependencies" + conflicts "--devel", "--HEAD" + conflicts "--build-from-source", "--build-bottle", "--force-bottle" formula_options end end diff --git a/Library/Homebrew/cmd/options.rb b/Library/Homebrew/cmd/options.rb index d113e6ef38..8fa65c3a1a 100644 --- a/Library/Homebrew/cmd/options.rb +++ b/Library/Homebrew/cmd/options.rb @@ -29,6 +29,7 @@ module Homebrew switch "--installed", description: "Show options for all installed formulae." switch :debug + conflicts "--all", "--installed" end end diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb index 63afc3666d..6477dc2b8d 100644 --- a/Library/Homebrew/cmd/outdated.rb +++ b/Library/Homebrew/cmd/outdated.rb @@ -46,6 +46,7 @@ module Homebrew "formula is outdated. Otherwise, the repository's HEAD will be checked for "\ "updates when a new stable or devel version has been released." switch :debug + conflicts "--quiet", "--verbose", "--json=" end end diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index 0b0abe0a7d..d1d7a0f05c 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -60,6 +60,7 @@ module Homebrew description: "Print the verification and postinstall steps." switch "--display-times", description: "Print install times for each formula at the end of the run." + conflicts "--build-from-source", "--force-bottle" formula_options end end diff --git a/Library/Homebrew/cmd/unpack.rb b/Library/Homebrew/cmd/unpack.rb index a13351f50a..f091df6d78 100644 --- a/Library/Homebrew/cmd/unpack.rb +++ b/Library/Homebrew/cmd/unpack.rb @@ -34,6 +34,7 @@ module Homebrew switch :force switch :verbose switch :debug + conflicts "--git", "--patch" end end diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 798a7e6418..71c6b81e7e 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -81,6 +81,7 @@ module Homebrew description: "Print the verification and postinstall steps." switch "--display-times", description: "Print install times for each formula at the end of the run." + conflicts "--build-from-source", "--force-bottle" formula_options end end diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb index f5d4a73ef1..654211dbad 100644 --- a/Library/Homebrew/cmd/uses.rb +++ b/Library/Homebrew/cmd/uses.rb @@ -59,6 +59,7 @@ module Homebrew switch "--HEAD", description: "Show usage of by HEAD build." switch :debug + conflicts "--devel", "--HEAD" end end diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 95d64c0202..26c077fed1 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -104,6 +104,7 @@ module Homebrew switch :quiet switch :verbose switch :debug + conflicts "--no-audit", "--strict" conflicts "--url", "--tag" end end diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb index 69b3a7e12e..1f219c29b1 100644 --- a/Library/Homebrew/dev-cmd/create.rb +++ b/Library/Homebrew/dev-cmd/create.rb @@ -59,6 +59,7 @@ module Homebrew switch :force switch :verbose switch :debug + conflicts "--autotools", "--cmake", "--meson" end end diff --git a/Library/Homebrew/dev-cmd/test.rb b/Library/Homebrew/dev-cmd/test.rb index 1198bd73d3..cdd4837ec9 100644 --- a/Library/Homebrew/dev-cmd/test.rb +++ b/Library/Homebrew/dev-cmd/test.rb @@ -41,6 +41,7 @@ module Homebrew description: "Keep the temporary files created for the test." switch :verbose switch :debug + conflicts "--devel", "--HEAD" end end