diff --git a/bin/rsyntaxtree b/bin/rsyntaxtree index 2ad5de7..26e4ee2 100755 --- a/bin/rsyntaxtree +++ b/bin/rsyntaxtree @@ -18,6 +18,7 @@ opts = Optimist.options do BANNER opt :outdir, "Output directory", default: "./" + opt :outfilename, "Output file base name", default: "syntree" opt :format, "Output format: png, pdf, or svg", default: "png" opt :leafstyle, "visual style of tree leaves: auto, triangle, bar, or nothing", default: "auto" opt :fontstyle, "Font style (available when ttf font is specified): sans, serif, cjk, mono", default: "sans" @@ -69,7 +70,8 @@ begin string_opts[:data] = data rsg = RSyntaxTree::RSGenerator.new(string_opts) ext = string_opts[:format] - filepath = File.expand_path(string_opts[:outdir]) + "/syntree." + ext + outfilename = string_opts[:outfilename] || "syntree" + filepath = File.expand_path(string_opts[:outdir]) + "/#{outfilename}." + ext case ext when "pdf" outfile = File.new(filepath, "wb") diff --git a/lib/rsyntaxtree/version.rb b/lib/rsyntaxtree/version.rb index 8b11e79..b9d8c96 100755 --- a/lib/rsyntaxtree/version.rb +++ b/lib/rsyntaxtree/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module RSyntaxTree - VERSION = "1.2.12" + VERSION = "1.3.0" end