Skip to content

Commit

Permalink
outfilename option added
Browse files Browse the repository at this point in the history
  • Loading branch information
yohasebe committed Aug 26, 2024
1 parent 68e82b8 commit 4710348
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bin/rsyntaxtree
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion lib/rsyntaxtree/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module RSyntaxTree
VERSION = "1.2.12"
VERSION = "1.3.0"
end

0 comments on commit 4710348

Please sign in to comment.