Module: UN
Do not use. This module is for internal use only.
Relationships & Source Files | |
Defined in: | lib/un.rb |
Class Method Summary
- .help(argv, output: $stdout) mod_func
Class Method Details
.help(argv, output: $stdout) (mod_func)
[ GitHub ]# File 'lib/un.rb', line 414
def help(argv, output: $stdout) all = argv.empty? cmd = nil if all store = proc {|msg| output << msg} else = {} store = proc {|msg| [cmd] = msg} end open(__FILE__) do |me| while me.gets("##\n") if help = me.gets("\n\n") if all or argv.include?(cmd = help[/^#\s*ruby\s.*-e\s(\w)/, 1]) store[help.gsub(/^# ?/, "")] break unless all or argv.size > .size end end end end if argv.each {|arg| output << [arg]} end end