diff --git a/eplot b/eplot index 81748e0..8c3ba64 100755 --- a/eplot +++ b/eplot @@ -81,6 +81,7 @@ Output file format options: -p --postscript Output to the postscript file foo.ps -a --pdf Output to the pdf file foo.pdf -e --emf Output to the emf file foo.emf + -c --canvas Output to the HTML5 canvas enhanced mousing file foo.html -o Specify the output filename -d --dumb Output to dumb terminal (ascii art) @@ -103,6 +104,7 @@ Miscellaneous opions: -B , creates vertical bars (separated by @) e.g. -B 100,0.8@200,0.8 -D --dump dump all used files as "eplot-dump-.dat" + -O --open Immediately open output file -h --help print this help message -v --version print version information MARKER_MESSAGE @@ -170,6 +172,11 @@ class OptionController com=com+"set terminal emf \"helvetica\";\n" @o["OutputFileDefault"]="foo.emf" + # ---- Do we create HTML output? + when /^-c$|^--canvas$/ + com=com+"set terminal canvas enhanced mousing;\n" + @o["OutputFileDefault"]="foo.html" + # ---- Do we create PDF output? First we create postscript # ---- A conversion is done afterwards when /^-a$|^--acrobat$|--pdf$/ @@ -181,6 +188,10 @@ class OptionController @o["OutputFileSpecified"]=checkOptArg(xargv,i) i=i+1 + # ---- Open output file + when /^-O$|^--open$/ + @o["OpenFile"]=true + # ---- Do we print to dumb terminal? when /^-d$|^--dumb$/ com=com+"set terminal dumb;\n" @@ -408,6 +419,12 @@ class Controller com="rm -f foo.ps foo.epsi" printAndRun(com) end + + if @oc["OpenFile"] + file = @oc["OutputFileSpecified"]!="" ? @oc["OutputFileSpecified"] : @oc["OutputFileDefault"] + com="open #{file}" + printAndRun(com) + end end # --------------------------------------------------------------------------