OSDN Git Service

Allow multiple argument to upload. v0.1.3
authorTatsuki Sugiura <sugi@nemui.org>
Thu, 26 May 2016 08:45:11 +0000 (17:45 +0900)
committerTatsuki Sugiura <sugi@nemui.org>
Thu, 26 May 2016 08:45:11 +0000 (17:45 +0900)
ChangeLog
lib/osdn/cli/command/frs_upload.rb
lib/osdn/cli/command/relfile.rb
lib/osdn/cli/version.rb

index 1d91360..2daefd2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-26  Tatsuki Sugiura  <sugi@nemui.org>
+
+       * Version 0.1.3
+       * frs_uplaod, relfile: Allow multiple target arguments.
+
 2016-05-18  Tatsuki Sugiura  <sugi@nemui.org>
 
        * Version 0.1.2
index 97c1793..ae112c3 100644 (file)
@@ -46,7 +46,13 @@ module OSDN; module CLI; module Command
         end
       end
 
-      @target_dir = Pathname.new(ARGV.shift || '.')
+      (ARGV.empty? ? ['.'] : ARGV).each do |d|
+        @target_dir = Pathname.new(d)
+        process_target
+      end
+    end
+
+    def process_target
       proj_info = api.get_project target_proj # check project existance
 
       vars = load_variables(@target_dir)
index 6ea473e..6b612e6 100644 (file)
@@ -5,7 +5,7 @@ module OSDN; module CLI; module Command
   class Relfile < FrsBase
     def help
       puts "#{$0} relfile [opts] [list]"
-      puts "#{$0} relfile [opts] create <target-file>"
+      puts "#{$0} relfile [opts] create <target-file> [target-files...]"
       puts "#{$0} relfile [opts] update <numeric-file-id>"
       puts "#{$0} relfile [opts] delete <numeric-file-id>"
       puts "Options:"
@@ -69,12 +69,18 @@ module OSDN; module CLI; module Command
     end
 
     def create
-      filename = ARGV.shift
-      if !filename
+      if ARGV.empty? || ARGV.first == ""
         logger.fatal "Target filename is missing."
         help
         return
       end
+
+      ARGV.each do |f|
+        create_one(f)
+      end
+    end
+
+    def create_one(filename)
       file = Pathname('.') + filename
       logger.debug "Calculating digest for #{file}..."
 
index 8d3d4e5..ecb1132 100644 (file)
@@ -1,5 +1,5 @@
 module OSDN
   module CLI
-    VERSION = "0.1.2"
+    VERSION = "0.1.3"
   end
 end