Revision | 87419b018c25adc07bf563b2783739eb2734ea74 (tree) |
---|---|
Time | 2016-05-26 17:45:11 |
Author | Tatsuki Sugiura <sugi@nemu...> |
Commiter | Tatsuki Sugiura |
Allow multiple argument to upload.
@@ -1,3 +1,8 @@ | ||
1 | +2016-05-26 Tatsuki Sugiura <sugi@nemui.org> | |
2 | + | |
3 | + * Version 0.1.3 | |
4 | + * frs_uplaod, relfile: Allow multiple target arguments. | |
5 | + | |
1 | 6 | 2016-05-18 Tatsuki Sugiura <sugi@nemui.org> |
2 | 7 | |
3 | 8 | * Version 0.1.2 |
@@ -46,7 +46,13 @@ module OSDN; module CLI; module Command | ||
46 | 46 | end |
47 | 47 | end |
48 | 48 | |
49 | - @target_dir = Pathname.new(ARGV.shift || '.') | |
49 | + (ARGV.empty? ? ['.'] : ARGV).each do |d| | |
50 | + @target_dir = Pathname.new(d) | |
51 | + process_target | |
52 | + end | |
53 | + end | |
54 | + | |
55 | + def process_target | |
50 | 56 | proj_info = api.get_project target_proj # check project existance |
51 | 57 | |
52 | 58 | vars = load_variables(@target_dir) |
@@ -5,7 +5,7 @@ module OSDN; module CLI; module Command | ||
5 | 5 | class Relfile < FrsBase |
6 | 6 | def help |
7 | 7 | puts "#{$0} relfile [opts] [list]" |
8 | - puts "#{$0} relfile [opts] create <target-file>" | |
8 | + puts "#{$0} relfile [opts] create <target-file> [target-files...]" | |
9 | 9 | puts "#{$0} relfile [opts] update <numeric-file-id>" |
10 | 10 | puts "#{$0} relfile [opts] delete <numeric-file-id>" |
11 | 11 | puts "Options:" |
@@ -69,12 +69,18 @@ module OSDN; module CLI; module Command | ||
69 | 69 | end |
70 | 70 | |
71 | 71 | def create |
72 | - filename = ARGV.shift | |
73 | - if !filename | |
72 | + if ARGV.empty? || ARGV.first == "" | |
74 | 73 | logger.fatal "Target filename is missing." |
75 | 74 | help |
76 | 75 | return |
77 | 76 | end |
77 | + | |
78 | + ARGV.each do |f| | |
79 | + create_one(f) | |
80 | + end | |
81 | + end | |
82 | + | |
83 | + def create_one(filename) | |
78 | 84 | file = Pathname('.') + filename |
79 | 85 | logger.debug "Calculating digest for #{file}..." |
80 | 86 |
@@ -1,5 +1,5 @@ | ||
1 | 1 | module OSDN |
2 | 2 | module CLI |
3 | - VERSION = "0.1.2" | |
3 | + VERSION = "0.1.3" | |
4 | 4 | end |
5 | 5 | end |