lib/fassbinder/cli.rb in fassbinder-0.0.9 vs lib/fassbinder/cli.rb in fassbinder-0.0.10
- old
+ new
@@ -3,21 +3,19 @@
require 'fassbinder'
module Fassbinder
class CLI < Thor
desc 'all', 'Looks up all offers for an ASIN'
- method_option :locale, :required => true, :aliases => '-l'
+ method_option :locale, :aliases => '-l', :default => :us
def all(asin)
- locale = options[:locale] || :us
- lookup(asin, locale)
+ lookup(asin, options[:locale])
end
map 'a' => 'all'
desc 'kosher', 'Looks up kosher offers for an ASIN'
- method_option :locale, :required => true, :aliases => '-l'
+ method_option :locale, :aliases => '-l', :default => :us
def kosher(asin)
- locale = options[:locale] || :us
- lookup(asin, locale, true)
+ lookup(asin, options[:locale], true)
end
map 'k' => 'kosher'
private