2020-11-25 17:03:23 +01:00
|
|
|
# typed: true
|
2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-04-05 14:57:06 -04:00
|
|
|
require "formula"
|
|
|
|
require "keg"
|
2019-04-17 18:25:08 +09:00
|
|
|
require "cli/parser"
|
2014-09-20 14:31:44 +01:00
|
|
|
|
|
|
|
module Homebrew
|
2020-10-20 12:03:48 +02:00
|
|
|
extend T::Sig
|
|
|
|
|
2016-09-26 01:44:51 +02:00
|
|
|
module_function
|
|
|
|
|
2020-10-20 12:03:48 +02:00
|
|
|
sig { returns(CLI::Parser) }
|
2019-01-18 22:03:30 +05:30
|
|
|
def switch_args
|
|
|
|
Homebrew::CLI::Parser.new do
|
|
|
|
usage_banner <<~EOS
|
|
|
|
`switch` <formula> <version>
|
|
|
|
|
2019-08-06 14:22:24 -04:00
|
|
|
Symlink all of the specified <version> of <formula>'s installation into Homebrew's prefix.
|
2019-01-18 22:03:30 +05:30
|
|
|
EOS
|
2020-07-30 18:40:10 +02:00
|
|
|
|
2020-03-04 17:28:15 +00:00
|
|
|
named 2
|
2020-11-02 11:20:09 +00:00
|
|
|
hide_from_man_page!
|
2019-01-18 22:03:30 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-09-20 14:31:44 +01:00
|
|
|
def switch
|
2020-12-18 14:17:23 +00:00
|
|
|
switch_args.parse
|
2018-03-30 15:01:41 +01:00
|
|
|
|
2020-12-18 14:17:23 +00:00
|
|
|
odisabled "`brew switch`", "`brew link` @-versioned formulae"
|
2014-09-20 14:31:44 +01:00
|
|
|
end
|
|
|
|
end
|