# File lib/drydock.rb, line 149 149: def prepare(cmd_str=nil, argv=[], stdin=[], global_options={}, options={}) 150: @alias = cmd_str.nil? ? @cmd : cmd_str 151: 152: global_options.each_pair do |n,v| 153: self.global.send("#{n}=", v) # Populate the object's globals 154: end 155: 156: options.each_pair do |n,v| 157: self.option.send("#{n}=", v) # ... and also the command options 158: end 159: 160: @argv << argv # TODO: Using += returns an Array instead of FancyArray 161: @argv.flatten! # NOTE: << creates @argv[[]] 162: @stdin = stdin 163: 164: self.init if self.respond_to? :init # Must be called first! 165: 166: end