lib/trinidad/command_line_parser.rb in calavera-trinidad-0.3.0 vs lib/trinidad/command_line_parser.rb in calavera-trinidad-0.4.0

- old
+ new

@@ -7,11 +7,13 @@ :port => 3000, :environment => 'development', :context_path => '/', :libs_dir => 'lib', :classes_dir => 'classes', - :config => 'config/tomcat.yml' + :config => 'config/tomcat.yml', + :ssl_port => 8443, + :ajp_port => 8009 } parser = OptionParser.new do |opts| opts.banner = 'Trinidad server default options:' opts.separator '' @@ -39,13 +41,25 @@ opts.on('--classes', '--classes CLASSES_DIR', 'Directory containing classes used by the application', "default: #{default_options[:classes_dir]}") do |v| default_options[:classes_dir] = v end + opts.on('-s', '--ssl [SSL_PORT]', 'Enable secure socket layout', + "default port: #{default_options[:ssl_port]}") do |v| + ssl_port = v.nil? ? default_options.delete(:ssl_port) : v.to_i + default_options[:ssl] = {:port => ssl_port} + end + + opts.on('-a', '--ajp [AJP_PORT]', 'Enable ajp connections', + "default port: #{default_options[:ajp_port]}") do |v| + ajp_port = v.nil? ? default_options.delete(:ajp_port) : v.to_i + default_options[:ajp] = {:port => ajp_port} + end + opts.on('-f', '--config [CONFIG_FILE]', 'Configuration file', "default: #{default_options[:config]}") do |v| default_options[:config] = v if v - default_options.merge! YAML.load_file(default_options[:config]) + default_options.deep_merge! YAML.load_file(default_options[:config]) end opts.on('-v', '--version', 'display the current version') do puts File.read(File.join(File.dirname(__FILE__), '..', '..', 'VERSION')).chomp exit \ No newline at end of file