bin/stackprof-webnav in stackprof-webnav-0.0.1 vs bin/stackprof-webnav in stackprof-webnav-0.0.2

- old
+ new

@@ -5,17 +5,22 @@ options = { :port => 9292 } parser = OptionParser.new(ARGV) do |o| - o.banner = "Usage: stackprof-webnav file.dump [-p NUMBER]" + o.banner = "Usage: stackprof-webnav file.dump|http://path/to/file.dump [-p NUMBER]" o.on('-p [PORT]', 'Server port') {|port| options[:port] = port } end parser.parse! parser.abort(parser.help) if ARGV.empty? file = ARGV.pop - server = StackProf::Webnav::Server -server.report_dump_path = File.expand_path(file) -server.run! options[:port] \ No newline at end of file + +if File.exists?(file) + server.report_dump_path = File.expand_path(file) +else + server.report_dump_url = file +end + +server.run! options[:port]