From 4685120692e0bdea960d7a389801c2fc249b9d59 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Wed, 29 Sep 2021 22:24:20 +0900 Subject: [PATCH 1/2] add cask option to brew log --- Library/Homebrew/cmd/log.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cmd/log.rb b/Library/Homebrew/cmd/log.rb index d4fc2d7fe4..1157d73f1e 100644 --- a/Library/Homebrew/cmd/log.rb +++ b/Library/Homebrew/cmd/log.rb @@ -1,7 +1,6 @@ # typed: false # frozen_string_literal: true -require "formula" require "cli/parser" module Homebrew @@ -26,10 +25,15 @@ module Homebrew description: "Print only one commit." flag "-n", "--max-count=", description: "Print only a specified number of commits." + switch "--formula", "--formulae", + description: "Treat all named arguments as formulae." + switch "--cask", "--casks", + description: "Treat all named arguments as casks." conflicts "-1", "--max-count" + conflicts "--formula", "--cask" - named_args :formula, max: 1 + named_args [:formula, :cask], max: 1 end end @@ -43,7 +47,7 @@ module Homebrew if args.no_named? git_log HOMEBREW_REPOSITORY, args: args else - path = Formulary.path(args.named.first) + path = args.named.to_paths.first tap = Tap.from_path(path) git_log path.dirname, path, tap, args: args end From a6b7a9662a1a055dee3ec7f741f3fe54daa67635 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Thu, 30 Sep 2021 09:56:39 +0900 Subject: [PATCH 2/2] repair command description --- Library/Homebrew/cmd/log.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/log.rb b/Library/Homebrew/cmd/log.rb index 1157d73f1e..69a435fe0a 100644 --- a/Library/Homebrew/cmd/log.rb +++ b/Library/Homebrew/cmd/log.rb @@ -12,8 +12,8 @@ module Homebrew def log_args Homebrew::CLI::Parser.new do description <<~EOS - Show the `git log` for , or show the log for the Homebrew repository - if no formula is provided. + Show the `git log` for or , or show the log for the Homebrew repository + if no formula or cask is provided. EOS switch "-p", "-u", "--patch", description: "Also print patch from commit."