lib/td/command/td.rb in td-0.7.2 vs lib/td/command/td.rb in td-0.7.3
- old
+ new
@@ -16,11 +16,11 @@
define_method(:usage) do |errmsg|
require 'td/command/list'
puts op.to_s
puts ""
puts "commands:"
- puts TD::Command::List.help(op.summary_indent)
+ puts TreasureData::Command::List.help(op.summary_indent)
puts ""
puts "Type 'td help COMMAND' for more information on a specific command."
if errmsg
puts "error: #{errmsg}"
exit 1
@@ -56,32 +56,30 @@
usage nil if ARGV.empty?
cmd = ARGV.shift
require 'td/config'
if config_path
- TD::Config.path = config_path
+ TreasureData::Config.path = config_path
end
if apikey
- TD::Config.apikey = apikey
+ TreasureData::Config.apikey = apikey
end
rescue
usage $!.to_s
end
require 'td/command/list'
-method = TD::Command::List.get_method(cmd)
+method = TreasureData::Command::List.get_method(cmd)
unless method
$stderr.puts "'#{cmd}' is not a td command. Run '#{$prog}' to show the list."
- TD::Command::List.show_guess(cmd)
+ TreasureData::Command::List.show_guess(cmd)
exit 1
end
-require 'td/error'
-
begin
method.call
-rescue TD::ConfigError
+rescue TreasureData::ConfigError
$stderr.puts "TreasureData account is not configured yet."
$stderr.puts "Run '#{$prog} account' first."
rescue
$stderr.puts "error #{$!.class}: backtrace:"
$!.backtrace.each {|b|