lib/beerdb/cli/opts.rb in beerdb-0.8.1 vs lib/beerdb/cli/opts.rb in beerdb-0.8.2
- old
+ new
@@ -1,18 +1,27 @@
module BeerDb
class Opts
-
- def merge_commander_options!( options = {} )
+ def merge_gli_options!( options = {} )
@db_path = options[:dbpath] if options[:dbpath].present?
@db_name = options[:dbname] if options[:dbname].present?
- @data_path = options[:include] if options[:include].present?
-
+ @verbose = true if options[:verbose] == true
+
+ @data_path = options[:include] if options[:include].present?
@world_data_path = options[:worldinclude] if options[:worldinclude].present?
end
+
+ def verbose=(boolean) # add: alias for debug ??
+ @verbose = boolean
+ end
+
+ def verbose?
+ return false if @verbose.nil? # default verbose/debug flag is false
+ @verbose == true
+ end
def db_path
@db_path || '.'
end