Merge pull request #8 from ernstki/print-dash-dash-help-to-stdout

Print '--help' and '--version' to stdout instead of stderr
This commit is contained in:
Christian Wolf 2020-08-05 20:15:16 +02:00 committed by GitHub
commit aa4d607f05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

32
eplot
View File

@ -153,8 +153,8 @@ class OptionController
usage usage
when /^-v$|^--version$/ when /^-v$|^--version$/
$stderr.puts "eplot version "+$Version puts "eplot version "+$Version
$stderr.puts $licence puts $licence
exit 0 exit 0
# ---- Do we create PNG output? # ---- Do we create PNG output?
@ -187,9 +187,9 @@ class OptionController
@o["OutputFileSpecified"]=checkOptArg(xargv,i) @o["OutputFileSpecified"]=checkOptArg(xargv,i)
i=i+1 i=i+1
# ---- Do we print to dumb terminal? # ---- Do we print to dumb terminal?
when /^-d$|^--dumb$/ when /^-d$|^--dumb$/
com=com+"set terminal dumb;\n" com=com+"set terminal dumb;\n"
# ---- Multiple curves in a single diagram from different files # ---- Multiple curves in a single diagram from different files
when /^-m$|^--mulfrmul$/ when /^-m$|^--mulfrmul$/
@ -199,7 +199,7 @@ class OptionController
when /^-M$|^--mulfrsin$/ when /^-M$|^--mulfrsin$/
@o["MulFrSin"]=true @o["MulFrSin"]=true
# ---- Multiple curves in a single diagram from a single column # ---- Multiple curves in a single diagram from a single column
when /^-S$|^--mulfrsinseq$/ when /^-S$|^--mulfrsinseq$/
@o["MulFrSeq"]=true @o["MulFrSeq"]=true
@ -243,15 +243,15 @@ class OptionController
com=com+"set xlabel \""+checkOptArg(xargv,i)+"\";\n" com=com+"set xlabel \""+checkOptArg(xargv,i)+"\";\n"
i=i+1 i=i+1
# ---- log x-axis # ---- log x-axis
when /^--xlog$/ when /^--xlog$/
com=com+"set logscale x;\n" com=com+"set logscale x;\n"
# ---- log y-axis # ---- log y-axis
when /^--ylog$/ when /^--ylog$/
com=com+"set logscale y;\n" com=com+"set logscale y;\n"
# ---- the y-axis label # ---- the y-axis label
when /^-y$|^--ylabel$/ when /^-y$|^--ylabel$/
com=com+"set ylabel \""+checkOptArg(xargv,i)+"\";\n" com=com+"set ylabel \""+checkOptArg(xargv,i)+"\";\n"
i=i+1 i=i+1
@ -321,8 +321,8 @@ class OptionController
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# ---- writes the usage message # ---- writes the usage message
def usage def usage
$stderr.printf "usage: %s [ options ]\n",$0 printf "usage: %s [ options ]\n",$0
$stderr.printf "\n%s\n",$help printf "\n%s\n",$help
exit 0 exit 0
end end
@ -399,7 +399,7 @@ class Controller
# ---- print the options # ---- print the options
com="echo '\n"+getStyleString+@oc["MiscOptions"] com="echo '\n"+getStyleString+@oc["MiscOptions"]
com=com+"set multiplot;\n" if doMultiPlot com=com+"set multiplot;\n" if doMultiPlot
com=com+"plot "+@oc["Range"]+comString+"\n'| gnuplot -persist" com=com+"plot "+@oc["Range"]+comString+"\n'| gnuplot -persist"
printAndRun(com) printAndRun(com)
# ---- convert to PDF # ---- convert to PDF
if @oc["DoPDF"] if @oc["DoPDF"]