From 49cb2345c657c805762a368cf46a1cbb75c6ca92 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 13 Jul 2020 00:30:44 +0900 Subject: [PATCH] sync_default_gems.rb: Added `list` subcommand --- tool/sync_default_gems.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index 5c70b3c24e..51ac521766 100644 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -470,6 +470,13 @@ when "up" end when "all" $repositories.keys.each{|gem| sync_default_gems(gem.to_s)} +when "list" + ARGV.shift + pattern = Regexp.new(ARGV.join('|')) + $repositories.each_pair do |name, gem| + next unless pattern =~ name or pattern =~ gem + printf "%-15s https://github.com/%s\n", name, gem + end when nil, "-h", "--help" puts <<-HELP \e[1mSync with upstream code of default libraries\e[0m @@ -482,6 +489,12 @@ when nil, "-h", "--help" \e[1mPick a commit range from the upstream repository\e[0m ruby #$0 rubygems 97e9768612..9e53702832 + +\e[1mList known libraries\e[0m + ruby #$0 list + +\e[1mList known libraries matching with patterns\e[0m + ruby #$0 list read HELP exit