32 lines
734 B
Ruby
Raw Normal View History

2024-09-13 12:22:52 -07:00
# typed: strict
# frozen_string_literal: true
2024-09-18 15:33:49 -07:00
module OS
module Linux
module CLI
module Parser
extend T::Helpers
2024-09-13 12:22:52 -07:00
2024-09-18 15:33:49 -07:00
requires_ancestor { Homebrew::CLI::Parser }
2024-09-13 12:22:52 -07:00
2024-12-06 14:14:02 -08:00
sig { void }
def set_default_options
2024-12-06 20:08:02 -08:00
args.set_arg(:formula?, true)
2024-12-06 14:14:02 -08:00
end
2024-09-18 15:33:49 -07:00
sig { void }
def validate_options
2024-12-06 14:14:02 -08:00
return unless args.respond_to?(:cask?)
return unless T.unsafe(self).args.cask?
2024-09-13 12:22:52 -07:00
2024-09-18 15:33:49 -07:00
# NOTE: We don't raise an error here because we don't want
# to print the help page or a stack trace.
odie "Invalid `--cask` usage: Casks do not work on Linux"
2024-09-13 12:22:52 -07:00
end
end
end
end
end
2024-09-18 15:33:49 -07:00
Homebrew::CLI::Parser.prepend(OS::Linux::CLI::Parser)