bin/rpush in rpush-1.0.0-java vs bin/rpush in rpush-2.0.0.beta1
- old
+ new
@@ -14,11 +14,20 @@
opts.on('-F N', '--feedback-poll N', Integer, "Frequency in seconds to check for feedback.") { |n| config.feedback_poll = n }
opts.on('-e', '--no-error-checks', 'Disable APNs error checking after notification delivery.') { config.check_for_errors = false }
opts.on('-p PATH', '--pid-file PATH', String, 'Path to write PID file. Relative to Rails root unless absolute.') { |path| config.pid_file = path }
opts.on('-b N', '--batch-size N', Integer, 'Storage backend notification batch size.') { |n| config.batch_size = n }
opts.on('-B', '--[no-]batch-storage-updates', 'Perform storage updates in batches.') { |v| config.batch_storage_updates = v }
- opts.on('-v', '--version', 'Print the version.') { puts "rpush #{Rpush::VERSION}"; exit }
- opts.on('-h', '--help', 'You\'re looking at it.') { puts opts; exit }
+ opts.on('-v', '--version', 'Print the version.') do
+ puts "rpush #{Rpush::VERSION}"
+ exit
+ end
+ opts.on('-h', '--help', 'You\'re looking at it.') do
+ hidden_switches = %w(-e --no-error-checks)
+ puts opts.to_s.split("\n").delete_if do |line|
+ hidden_switches.any? { |s| line =~ /#{s}/ }
+ end.join("\n")
+ exit
+ end
end
if environment.nil? || environment =~ /^-/
puts options.to_s
exit 1