Apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
cb71938fff
commit
98d36c30c5
@ -136,9 +136,9 @@ begin
|
|||||||
end
|
end
|
||||||
rescue UsageError => e
|
rescue UsageError => e
|
||||||
require "help"
|
require "help"
|
||||||
Homebrew::Help.help cmd, remaining_args: T.must(args).remaining, usage_error: e.message
|
Homebrew::Help.help cmd, remaining_args: args&.remaining, usage_error: e.message
|
||||||
rescue SystemExit => e
|
rescue SystemExit => e
|
||||||
onoe "Kernel.exit" if T.must(args).debug? && !e.success?
|
onoe "Kernel.exit" if args&.debug? && !e.success?
|
||||||
$stderr.puts Utils::Backtrace.clean(e) if args&.debug? || ARGV.include?("--debug")
|
$stderr.puts Utils::Backtrace.clean(e) if args&.debug? || ARGV.include?("--debug")
|
||||||
raise
|
raise
|
||||||
rescue Interrupt
|
rescue Interrupt
|
||||||
|
|||||||
@ -250,7 +250,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
sig {
|
sig {
|
||||||
params(names: String, description: T.nilable(String), replacement: T.untyped, depends_on: T.nilable(String),
|
params(names: String, description: T.nilable(String), replacement: T.any(Symbol, String, NilClass), depends_on: T.nilable(String),
|
||||||
hidden: T::Boolean).void
|
hidden: T::Boolean).void
|
||||||
}
|
}
|
||||||
def flag(*names, description: nil, replacement: nil, depends_on: nil, hidden: false)
|
def flag(*names, description: nil, replacement: nil, depends_on: nil, hidden: false)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user