Skip to content

Commit

Permalink
restore functionality of help system (closes JuliaLang#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Apr 7, 2012
1 parent 2d2783d commit 1c08d1f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions base/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,14 @@ end

# help

function parse_help(stream)
function parse_help(manual)
helpdb = HashTable()
for l = each_line(stream)
for l = split(manual,'\n')
if isempty(l)
continue
end
if length(l) >= 3 && l[1:3]=="## "
heading = l[4:end-1]
heading = l[4:end]
category = HashTable()
helpdb[heading] = category
continue
Expand Down Expand Up @@ -263,10 +263,8 @@ function _jl_init_help()
global _jl_helpdb
if _jl_helpdb == nothing
println("Downloading help data...")
cmd = `curl -s $_jl_help_url`
stream = fdio(read_from(cmd).fd, true)
spawn(cmd)
_jl_helpdb = parse_help(stream)
manual = readall(`curl -s $_jl_help_url`)
_jl_helpdb = parse_help(manual)
end
end

Expand Down Expand Up @@ -309,7 +307,7 @@ function _jl_print_help_entries(entries)
if !first
println()
end
print(desc[1], "\n ", desc[2])
println(desc[1], "\n ", desc[2])
first = false
end
end
Expand Down

0 comments on commit 1c08d1f

Please sign in to comment.