lib/td/command/common.rb in td-0.7.3 vs lib/td/command/common.rb in td-0.7.4
- old
+ new
@@ -1,13 +1,24 @@
module TreasureData
+
+autoload :API, 'td/api'
+autoload :Client, 'td/client'
+autoload :Database, 'td/client'
+autoload :Table, 'td/client'
+autoload :Schema, 'td/client'
+autoload :Job, 'td/client'
+
module Command
private
def cmd_opt(name, *args)
if args.last.to_s =~ /_$/
multi = true
args.push args.pop.to_s[0..-2]+'...'
+ elsif args.last.to_s =~ /_\?$/
+ multi = true
+ args.push args.pop.to_s[0..-3]+'...?'
end
req_args, opt_args = args.partition {|a| a.to_s !~ /\?$/ }
opt_args = opt_args.map {|a| a.to_s[0..-2].to_sym }
args = req_args + opt_args
@@ -59,10 +70,9 @@
def get_client
apikey = Config.apikey
unless apikey
raise ConfigError, "Account is not configured."
end
- require 'td/client'
Client.new(apikey)
end
def cmd_render_table(rows, *opts)
require 'hirb'