# File lib/active_ldap/command.rb, line 9 9: def parse_options(argv=nil, version=nil) 10: argv ||= ARGV.dup 11: options = OpenStruct.new 12: opts = OptionParser.new do |opts| 13: yield(opts, options) 14: 15: opts.separator "" 16: opts.separator _("Common options:") 17: 18: opts.on_tail("--config=CONFIG", 19: _("Specify configuration file written as YAML")) do |file| 20: require 'yaml' 21: config = YAML.load(File.read(file)).symbolize_keys 22: config = Base.prepare_configuration(config) 23: Configuration::DEFAULT_CONFIG.update(config) 24: end 25: 26: opts.on_tail("-h", "--help", _("Show this message")) do 27: puts opts 28: exit 29: end 30: 31: opts.on_tail("--version", _("Show version")) do 32: puts(version || VERSION) 33: exit 34: end 35: end 36: opts.parse!(argv) 37: [argv, opts, options] 38: end
# File lib/active_ldap/command.rb, line 40 40: def read_password(prompt, input=$stdin, output=$stdout) 41: output.print(prompt) 42: system("/bin/stty -echo") if input.tty? 43: input.gets.chomp 44: ensure 45: system("/bin/stty echo") if input.tty? 46: output.puts 47: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.