Merge pull request #5249 from GauthamGoli/migrate-args

migrate: Use CLI::Parser to parse args
This commit is contained in:
Gautham Goli 2018-11-05 21:46:29 +05:30 committed by GitHub
commit 2973e1521f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,11 +6,30 @@
#: like if they are from same taps and migrate them anyway.
require "migrator"
require "cli_parser"
module Homebrew
module_function
def migrate_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`migrate` [<options>] <formulae>
Migrate renamed packages to new name, where <formulae> are old names of
packages.
EOS
switch :force,
description: "Treat installed <formulae> and passed <formulae> like if they are from "\
"same taps and migrate them anyway."
switch :verbose
switch :debug
end
end
def migrate
migrate_args.parse
raise FormulaUnspecifiedError if ARGV.named.empty?
ARGV.resolved_formulae.each do |f|