lib/cli.rb in vespa-0.0.1 vs lib/cli.rb in vespa-0.0.2
- old
+ new
@@ -3,11 +3,11 @@
# :name is optional, otherwise uses the basename of this executable
appname = "vespa"
program :name, 'JBoss HornetQ RESTful command line'
-program :version, '0.0.1'
+program :version, '0.0.2'
program :description, 'Interact with the JBoss HornetQ RESTful API from the command line'
command :topic do |c|
c.syntax = "#{appname} topic <name>"
c.description = 'Enqueue a message on a topic'
@@ -23,14 +23,14 @@
options.default :server => 'localhost', :port => '8180', :context => 'messaging', :subscriber => 'bob', :durable => true
raise "You must provide the topic name" if args[0].nil?
topic = Topic.new(options.server,options.port,options.context,args[0],options.subscriber)
if !(options.payload.nil?)
topic.enqueue(options.payload,options.durable)
- elsif !(options.push.nil?)
+ elsif options.push
topic.enqueue($stdin.read,options.durable)
end
- if !(options.pull.nil?)
+ if options.pull
topic.dequeue(options.durable)
end
end
end
\ No newline at end of file