mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
unpin: Use CLI::Parser to parse args
This commit is contained in:
parent
b0f382c177
commit
e8ceda3ad8
@ -3,12 +3,28 @@
|
||||
#: See also `pin`.
|
||||
|
||||
require "formula"
|
||||
require "cli_parser"
|
||||
|
||||
module Homebrew
|
||||
module_function
|
||||
|
||||
def unpin_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
usage_banner <<~EOS
|
||||
`unpin` <formulae>
|
||||
|
||||
Unpin <formulae>, allowing them to be upgraded by `brew upgrade` <formulae>.
|
||||
See also `pin`.
|
||||
EOS
|
||||
switch :verbose
|
||||
switch :debug
|
||||
end
|
||||
end
|
||||
|
||||
def unpin
|
||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||
unpin_args.parse
|
||||
|
||||
raise FormulaUnspecifiedError if args.remaining.empty?
|
||||
|
||||
ARGV.resolved_formulae.each do |f|
|
||||
if f.pinned?
|
||||
|
Loading…
x
Reference in New Issue
Block a user