2020-11-25 17:03:23 +01:00
|
|
|
# typed: true
|
2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-03-15 12:55:14 -05:00
|
|
|
require "formula"
|
2019-04-17 18:25:08 +09:00
|
|
|
require "cli/parser"
|
2014-03-15 12:55:14 -05:00
|
|
|
|
2014-06-18 22:41:47 -05: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) }
|
2018-10-27 22:59:08 +05:30
|
|
|
def diy_args
|
|
|
|
Homebrew::CLI::Parser.new do
|
|
|
|
usage_banner <<~EOS
|
|
|
|
`diy` [<options>]
|
|
|
|
|
|
|
|
Automatically determine the installation prefix for non-Homebrew software.
|
|
|
|
Using the output from this command, you can install your own software into
|
|
|
|
the Cellar and then link it into Homebrew's prefix with `brew link`.
|
|
|
|
EOS
|
2019-08-06 13:23:19 -04:00
|
|
|
flag "--name=",
|
2019-08-20 00:04:14 -04:00
|
|
|
description: "Explicitly set the <name> of the package being installed."
|
2019-08-06 13:23:19 -04:00
|
|
|
flag "--version=",
|
2019-08-20 00:04:14 -04:00
|
|
|
description: "Explicitly set the <version> of the package being installed."
|
2020-07-30 18:40:10 +02:00
|
|
|
|
2019-12-13 16:50:54 -05:00
|
|
|
max_named 0
|
2020-11-24 16:44:02 +00:00
|
|
|
hide_from_man_page!
|
2018-10-27 22:59:08 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-09-11 20:22:54 +01:00
|
|
|
def diy
|
2020-12-18 14:17:23 +00:00
|
|
|
diy_args.parse
|
2018-10-27 22:59:08 +05:30
|
|
|
|
2020-12-18 14:17:23 +00:00
|
|
|
odisabled "`brew diy`"
|
2014-03-15 12:55:14 -05:00
|
|
|
end
|
2010-09-11 20:22:54 +01:00
|
|
|
end
|