File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,23 @@ require "fileutils"
12
12
require_relative "../lib/ruby_h_to_go"
13
13
14
14
header_dir = nil
15
+ dist_dir = nil
16
+
17
+ DEFAULT_RUBY_HEADER_DIR = RbConfig ::CONFIG [ "rubyhdrdir" ]
18
+ DEFAULT_DIST_DIR = File . expand_path ( "../dist" , __dir__ )
15
19
16
20
opt = OptionParser . new
17
- opt . on ( "-H HEADER_DIR" ) { |v | header_dir = v }
21
+ opt . on ( "-H" , "--header-dir HEADER_DIR" , "ruby header dir (default: #{ DEFAULT_RUBY_HEADER_DIR } )" ) { |v | header_dir = v }
22
+
23
+ opt . on ( "-D" , "--dist-dir DIST_DIR" , "dist dir for auto-generated Go code (default: #{ DEFAULT_DIST_DIR } )" ) do |v |
24
+ dist_dir = v
25
+ end
18
26
19
27
opt . parse! ( ARGV )
20
28
21
29
# Use default header file and include paths
22
- header_dir ||= RbConfig ::CONFIG [ "rubyhdrdir" ]
30
+ header_dir ||= DEFAULT_RUBY_HEADER_DIR
31
+
32
+ dist_dir ||= DEFAULT_DIST_DIR
23
33
24
- RubyHToGo ::Cli . new ( header_dir :, dist_dir : File . join ( __dir__ , ".." , "dist" ) ) . perform
34
+ RubyHToGo ::Cli . new ( header_dir :, dist_dir :) . perform
You can’t perform that action at this time.
0 commit comments