6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/irgat/help.rb', line 6
def show_help(pattern, exit_irgat = false)
help_file = IRGAT_LANG + "/help_cmd_#{ @config[:lang] }.rb"
if ! test(?e, help_file)
puts "Help file #{ help_file } not found. Check the install or choose another language in your irgat config file"
puts "Loading default Lang"
help_file = IRGAT_LANG + "/help_cmd_en.rb"
end
= File.open(help_file) do |file|
RDoc.(file)
end
= .gsub(/^\s*#/, '')
markup = SM::SimpleMarkup.new
flow_convertor = SM::ToFlow.new
flow = markup.convert(, flow_convertor)
format = "plain"
pattern = (pattern.length == 0 ? 'index' : pattern.to_s)
$stdout = File.new('/dev/null',"w+")
searched_flow = RDoc.(flow, pattern)
$stdout = STDOUT
if flow == searched_flow
puts "[ Error ] No section founded for your petition #{ pattern }"
puts "Try a diffent pattern search or try $ irgat help without search pattern to view a list of avaibles sections"
else
options = RI::Options.instance
if args = ENV["RI"]
options.parse(args.split)
end
formatter = options.formatter.new(options, "")
formatter.display_flow(searched_flow)
end
end
|