This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new dc58ac8  Allow specification of multiple args
dc58ac8 is described below

commit dc58ac89b26d7a1b3bc43e8423888db8f8e2fdb5
Author: Sebb <[email protected]>
AuthorDate: Fri Jul 24 15:32:32 2020 +0100

    Allow specification of multiple args
---
 Rakefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Rakefile b/Rakefile
index c429932..81d385e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -117,6 +117,7 @@ end
 namespace :svn do
   task :update, [:arg1] => :config do |task, args|
     arg1 = args.arg1 || '' # If defined, it is either the name of a checkout 
to update or 'skip'
+    options = [arg1, args.extras].flatten # capture all options
     # Include all
     svnrepos = ASF::SVN.repo_entries(true) || {}
 
@@ -130,9 +131,10 @@ namespace :svn do
       mkdir_p? File.dirname(svn)
       Dir.chdir File.dirname(svn) do
         svnrepos.each do |name, description|
-          # skip the update unless it matches the parameter provided
+          # skip the update unless it matches the parameter (if any) provided
           # 'skip' is special and means update all list files
-          next unless name == arg1 || arg1 == 'skip' || arg1 == ''
+          # The empty string means no options provided
+          next unless ['skip', ''].include?(arg1)  || options.include?(name)
           puts
           puts File.join(Dir.pwd, name)
           if description['list']

Reply via email to