bin/shell2html in shell2html-0.0.5 vs bin/shell2html in shell2html-0.0.6
- old
+ new
@@ -3,6 +3,17 @@
lib = File.expand_path('../../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'shell2html'
-puts "Nothing there yet."
+if ARGV.count > 0
+ file = ARGV[0]
+ if !File.exists? file
+ puts "File #{file} Not found"
+ exit(1)
+ end
+ puts Shell2html.to_html(File.read(file))
+else
+ txt = $stdin.read
+ puts Shell2html.to_html(txt)
+end
+