lib/har/viewer.rb in har-0.0.4 vs lib/har/viewer.rb in har-0.0.5

- old
+ new

@@ -12,13 +12,19 @@ if @options[:validate] args = validate(args) end - progress("Merging HARs...") { - @har = Archive.by_merging(args) - } + if args == ["-"] + progress("Reading HAR from stdin...") { + @har = Archive.from_file $stdin + } + else + progress("Merging HARs...") { + @har = Archive.by_merging args + } + end end def show s = server(create_root) launch_browser @@ -57,10 +63,10 @@ def parse(args) options = DEFAULT_OPTIONS.dup OptionParser.new do |opts| - opts.banner = "Usage: har [options] [files]" + opts.banner = "Usage: har [options] [files|-]" opts.on "-p", "--port PORT", Integer do |int| options[:port] = int end