# typed: strict # frozen_string_literal: true require "abstract_command" require "formula" require "cli/parser" module Homebrew module DevCmd class FormulaCmd < AbstractCommand sig { returns(String) } def self.command_name = "formula" cmd_args do description <<~EOS Display the path where is located. EOS named_args :formula, min: 1, without_api: true end sig { override.void } def run formula_paths = args.named.to_paths(only: :formula).select(&:exist?) if formula_paths.blank? && args.named .to_paths(only: :cask) .any?(&:exist?) odie "Found casks but did not find formulae!" end formula_paths.each { puts _1 } end end end end