vmc-ng/lib/vmc/cli.rb in vmc-0.4.0.beta.21 vs vmc-ng/lib/vmc/cli.rb in vmc-0.4.0.beta.22
- old
+ new
@@ -90,10 +90,11 @@
rescue Interrupt
exit_status 130
rescue Mothership::Error
raise
rescue UserError => e
+ log_error(e)
err e.message
rescue CFoundry::Denied => e
if !$vmc_asked_auth && e.error_code == 200
$vmc_asked_auth = true
@@ -288,26 +289,28 @@
end
@@client.proxy = option(:proxy)
@@client.trace = option(:trace)
- info[:version] ||=
- case @@client
- when CFoundry::V2::Client
- 2
- else
- 1
- end
+ unless info.key? :version
+ info[:version] =
+ case @@client
+ when CFoundry::V2::Client
+ 2
+ else
+ 1
+ end
+ save_target_info(info)
+ end
+
if org = info[:organization]
@@client.current_organization = @@client.organization(org)
end
if space = info[:space]
@@client.current_space = @@client.space(space)
end
-
- save_target_info(info)
@@client
end
class << self