diff --git a/bin/cli/sqs.rb b/bin/cli/sqs.rb index d46e89c6..4aa4acdc 100644 --- a/bin/cli/sqs.rb +++ b/bin/cli/sqs.rb @@ -96,8 +96,8 @@ def dump_file(path, queue_name) end desc 'ls [QUEUE-NAME-PREFIX]', 'Lists queues' - method_option :watch, aliases: '-w', type: :boolean, desc: 'watch queues' - method_option :watch_interval, type: :numeric, default: 10, desc: 'watch interval' + method_option :watch, aliases: '-w', type: :boolean, desc: 'watch queues' + method_option :interval, aliases: '-n', type: :numeric, default: 2, desc: 'watch interval in seconds' def ls(queue_name_prefix = '') trap('SIGINT', 'EXIT') # expect ctrl-c from loop @@ -108,7 +108,7 @@ def ls(queue_name_prefix = '') break unless options[:watch] - sleep options[:watch_interval] + sleep options[:interval] puts end end @@ -187,8 +187,12 @@ def purge(queue_name) end desc 'create QUEUE-NAME', 'Create a queue' + method_option :attributes, aliases: '-a', type: :hash, default: {}, desc: 'queue attributes' def create(queue_name) - queue_url = sqs.create_queue(queue_name: queue_name).queue_url + attributes = options[:attributes] + attributes['FifoQueue'] ||= 'true' if queue_name.end_with?('.fifo') + + queue_url = sqs.create_queue(queue_name: queue_name, attributes: attributes).queue_url say "Queue #{queue_name} was successfully created. Queue URL #{queue_url}", :green end diff --git a/bin/shoryuken b/bin/shoryuken index c00f52bd..37c0dbee 100755 --- a/bin/shoryuken +++ b/bin/shoryuken @@ -32,7 +32,7 @@ module Shoryuken opts = options.to_h.symbolize_keys if opts[:config_file] - say "[DEPRECATED] Please use --config instead of --config-file", :yellow + say '[DEPRECATED] Please use --config instead of --config-file', :yellow end opts[:config_file] = opts.delete(:config) if opts[:config]