lib/fakes3/cli.rb in fakes3-0.2.4 vs lib/fakes3/cli.rb in fakes3-0.2.5
- old
+ new
@@ -9,10 +9,11 @@
desc "server", "Run a server on a particular hostname"
method_option :root, :type => :string, :aliases => '-r', :required => true
method_option :port, :type => :numeric, :aliases => '-p', :required => true
method_option :address, :type => :string, :aliases => '-a', :required => false, :desc => "Bind to this address. Defaults to 0.0.0.0"
method_option :hostname, :type => :string, :aliases => '-H', :desc => "The root name of the host. Defaults to s3.amazonaws.com."
+ method_option :quiet, :type => :boolean, :aliases => '-q', :desc => "Quiet; do not write anything to standard output."
method_option :limit, :aliases => '-l', :type => :string, :desc => 'Rate limit for serving (ie. 50K, 1.0M)'
method_option :sslcert, :type => :string, :desc => 'Path to SSL certificate'
method_option :sslkey, :type => :string, :desc => 'Path to SSL certificate key'
def server
@@ -50,11 +51,11 @@
if (ssl_cert_path.nil? && !ssl_key_path.nil?) || (!ssl_cert_path.nil? && ssl_key_path.nil?)
abort "If you specify an SSL certificate you must also specify an SSL certificate key"
end
- puts "Loading FakeS3 with #{root} on port #{options[:port]} with hostname #{hostname}"
- server = FakeS3::Server.new(address,options[:port],store,hostname,ssl_cert_path,ssl_key_path)
+ puts "Loading FakeS3 with #{root} on port #{options[:port]} with hostname #{hostname}" unless options[:quiet]
+ server = FakeS3::Server.new(address,options[:port],store,hostname,ssl_cert_path,ssl_key_path, quiet: !!options[:quiet])
server.serve
end
desc "version", "Report the current fakes3 version"
def version