lib/ddbcli/cli/options.rb in ddbcli-0.1.4 vs lib/ddbcli/cli/options.rb in ddbcli-0.1.5

- old
+ new

@@ -20,9 +20,15 @@ opt.on('-k', '--access-key=ACCESS_KEY') {|v| options.access_key_id = v } opt.on('-s', '--secret-key=SECRET_KEY') {|v| options.secret_access_key = v } opt.on('-r', '--region=REGION_OR_ENDPOINT') {|v| options.ddb_endpoint_or_region = v } opt.on('-e', '--eval=COMMAND') {|v| options.command = v } opt.on('-t', '--timeout=SECOND', Integer) {|v| options.timeout = v.to_i } + + opt.on('', '--import=TABLE,JSON_FILE') {|v| + v = v.split(/\s*,\s*/, 2) + options.import = {:table => v[0], :file => v[1]} + } + opt.on('', '--consistent-read') { options.consistent = true } opt.on('', '--iteratable') { options.iteratable = true } opt.on('', '--retry=NUM', Integer) {|v| options.retry_num = v.to_i } opt.on('', '--retry-interval=SECOND', Integer) {|v| options.retry_intvl = v.to_i } opt.on('', '--debug') { options.debug = true }