diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-07-13 00:30:44 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-07-13 00:30:44 +0900 |
commit | 49cb2345c657c805762a368cf46a1cbb75c6ca92 (patch) | |
tree | c50abab67d0d5b1ebef4d85f4cb03712ec681a73 /tool/sync_default_gems.rb | |
parent | 6cd600ef697ef046651028538ab59233c335e5c6 (diff) |
sync_default_gems.rb: Added `list` subcommand
Diffstat (limited to 'tool/sync_default_gems.rb')
-rw-r--r-- | tool/sync_default_gems.rb | 13 |
1 files changed, 13 insertions, 0 deletions
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 |