2024-09-10 19:12:15 -07:00
|
|
|
# typed: strict
|
2022-09-28 21:57:13 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Homebrew
|
|
|
|
module CLI
|
2024-09-05 19:56:32 -07:00
|
|
|
module ParserLinux
|
|
|
|
extend T::Helpers
|
2022-09-28 21:57:13 -07:00
|
|
|
|
2024-09-05 19:56:32 -07:00
|
|
|
requires_ancestor { Homebrew::CLI::Parser }
|
|
|
|
|
|
|
|
sig { void }
|
2022-12-03 22:08:01 -08:00
|
|
|
def set_default_options
|
2024-09-10 19:12:15 -07:00
|
|
|
args["formula?"] = true if args.respond_to?(:formula?)
|
2022-12-03 22:08:01 -08:00
|
|
|
end
|
|
|
|
|
2024-09-05 19:56:32 -07:00
|
|
|
sig { void }
|
2022-09-28 21:57:13 -07:00
|
|
|
def validate_options
|
2024-09-10 19:12:15 -07:00
|
|
|
return unless args.respond_to?(:cask?)
|
|
|
|
return unless args.cask?
|
2022-09-28 21:57:13 -07:00
|
|
|
|
2023-01-02 10:59:08 -08:00
|
|
|
# NOTE: We don't raise an error here because we don't want
|
2024-04-26 20:55:51 +02:00
|
|
|
# to print the help page or a stack trace.
|
2023-01-02 10:59:08 -08:00
|
|
|
odie "Invalid `--cask` usage: Casks do not work on Linux"
|
2022-09-28 21:57:13 -07:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2024-09-05 19:56:32 -07:00
|
|
|
|
|
|
|
Homebrew::CLI::Parser.prepend(Homebrew::CLI::ParserLinux)
|