module Ratch # General Options module GeneralOptions # def argv @argv ||= ARGV.dup end # Convert command line argv to args. # # TODO Is this implmented as expected? def command_parameters argv.to_params end # Debug mode. def debug? @debug end # def trace? @trace ||= %w{--trace}.any?{|a| argv.delete(a)} end # def trace! @trace = true end # def noharm? @noharm ||= %w{--dryrun --dry-run --noharm}.any?{|a| argv.delete(a)} end alias_method :dryrun?, :noharm? ; module_function :dryrun? # def noharm! @noharm = true end alias_method :dryrun!, :noharm! ; module_function :dryrun! end end