Class: Rucc::Option
- Inherits:
-
Object
- Object
- Rucc::Option
- Defined in:
- lib/rucc/option.rb
Instance Attribute Summary collapse
-
#dontlink ⇒ Object
readonly
Returns the value of attribute dontlink.
-
#dumpasm ⇒ Object
readonly
Returns the value of attribute dumpasm.
-
#include_path ⇒ Object
readonly
Returns the value of attribute include_path.
-
#outfile ⇒ Object
readonly
Returns the value of attribute outfile.
Instance Method Summary collapse
-
#initialize ⇒ Option
constructor
A new instance of Option.
- #parse!(argv) ⇒ Object
Constructor Details
#initialize ⇒ Option
Returns a new instance of Option.
5 6 7 8 9 10 |
# File 'lib/rucc/option.rb', line 5 def initialize @include_path = [] @dumpasm = false @dontlink = false @outfile = nil end |
Instance Attribute Details
#dontlink ⇒ Object (readonly)
Returns the value of attribute dontlink.
11 12 13 |
# File 'lib/rucc/option.rb', line 11 def dontlink @dontlink end |
#dumpasm ⇒ Object (readonly)
Returns the value of attribute dumpasm.
11 12 13 |
# File 'lib/rucc/option.rb', line 11 def dumpasm @dumpasm end |
#include_path ⇒ Object (readonly)
Returns the value of attribute include_path.
11 12 13 |
# File 'lib/rucc/option.rb', line 11 def include_path @include_path end |
#outfile ⇒ Object (readonly)
Returns the value of attribute outfile.
11 12 13 |
# File 'lib/rucc/option.rb', line 11 def outfile @outfile end |
Instance Method Details
#parse!(argv) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rucc/option.rb', line 13 def parse!(argv) opt = OptionParser.new opt.on('-I include_path') do |v| @include_path.push v end opt.on('-S') do @dumpasm = true end opt.on('-c') do @dontlink = true end opt.on('-o outputfile') do |v| @outfile = v end opt.parse!(argv) end |