lib/hu/cli.rb in hu-1.1.2 vs lib/hu/cli.rb in hu-1.2.0
- old
+ new
@@ -1,31 +1,23 @@
require 'hu/version'
require 'optix'
require 'powerbar'
require 'yaml'
+require 'netrc'
require 'platform-api'
+require 'hu/common'
require 'hu/collab'
+require 'hu/deploy'
module Hu
class Cli < Optix::Cli
- API_TOKEN = ENV['HEROKU_API_TOKEN']
Optix::command do
text "Hu v#{Hu::VERSION} - Heroku Utility"
- if API_TOKEN.nil?
- text ""
- text "\e[1mWARNING: Environment variable 'HEROKU_API_TOKEN' must be set.\e[0m"
- end
- opt :quiet, "Don't show progress bar", :default => false
+ opt :quiet, "Quiet mode (no progress output)", :default => false
opt :version, "Print version and exit", :short => :none
trigger :version do
puts "Hu v#{Hu::VERSION}"
- end
- filter do
- if API_TOKEN.nil?
- STDERR.puts "\e[0;31;1mERROR: Environment variable 'HEROKU_API_TOKEN' must be set.\e[0m"
- exit 1
- end
end
filter do |cmd, opts, argv|
$quiet = opts[:quiet]
$quiet = true unless STDOUT.isatty
end