@@ -104,28 +104,43 @@ def connector_preview(op)
104104 $stdout. puts cmd_render_table ( rows , :fields => fields , :render_format => op . render_format , :resize => false )
105105
106106 $stdout. puts "Update #{ config_file } and use '#{ $prog} " + Config . cl_options_string + "connector:preview #{ config_file } ' to preview again."
107- $stdout. puts "Use '#{ $prog} " + Config . cl_options_string + "connector:issue #{ config_file } ' to run Server-side bulk load."
107+ $stdout. puts "Use '#{ $prog} " + Config . cl_options_string + "connector:issue database_name table_name #{ config_file } ' to run Server-side bulk load."
108108 end
109109
110110 def connector_issue ( op )
111- database = table = nil
112- time_column = nil
113- wait = exclude = false
114- auto_create = false
115-
116- op . on ( '--database DB_NAME' , "destination database" ) { |s | database = s }
117- op . on ( '--table TABLE_NAME' , "destination table" ) { |s | table = s }
111+ option_database = option_table = nil
112+ time_column = nil
113+ wait = exclude = false
114+ auto_create = false
115+
116+ op . on ( '--database DB_NAME' , "(obsoleted)" ) { |s |
117+ $stderr. puts '--database is obsolete option'
118+ option_database = s
119+ }
120+ op . on ( '--table TABLE_NAME' , "(obsoleted)" ) { |s |
121+ $stderr. puts '--table is obsolete option'
122+ option_table = s
123+ }
118124 op . on ( '--time-column COLUMN_NAME' , "data partitioning key" ) { |s | time_column = s } # unnecessary but for backward compatibility
119125 op . on ( '-w' , '--wait' , 'wait for finishing the job' , TrueClass ) { |b | wait = b }
120126 op . on ( '-x' , '--exclude' , 'do not automatically retrieve the job result' , TrueClass ) { |b | exclude = b }
121127 op . on ( '--auto-create-table' , "Create table and database if doesn't exist" , TrueClass ) { |b |
122128 auto_create = b
123129 }
124130
125- config_file = op . cmd_parse
131+ database , table , config_file = nil
132+ args = op . cmd_parse
133+
134+ if args . instance_of? String
135+ config_file = args
136+ database = option_database
137+ table = option_table
138+ else
139+ database , table , config_file = args
140+ end
126141
127- required ( '-- database' , database )
128- required ( '-- table' , table )
142+ required ( 'database' , database )
143+ required ( 'table' , table )
129144
130145 config = prepare_bulkload_job_config ( config_file )
131146 ( config [ 'out' ] ||= { } ) [ 'time_column' ] = time_column if time_column # TODO will not work once embulk implements multi-job
0 commit comments