Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion base/help.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Help

export help, apropos, @help
export help, apropos, @help, @methods

CATEGORY_LIST = nothing
CATEGORY_DICT = nothing
Expand Down Expand Up @@ -228,4 +228,12 @@ macro help(ex)
end
end

macro methods(ex)
if !isa(ex, Expr) || isname(ex)
return Expr(:call, :methods, esc(ex))
else
return Expr(:macrocall, symbol("@which"), esc(ex))
end
end

end # module
5 changes: 3 additions & 2 deletions ui/repl-readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@ static jl_value_t* repl_parse_input_line(char *buf) {
JL_GC_POP();
return result;
}
else if (buf[0] == '?') {
else if (buf[0] == '?' || buf[0] == ')') {
char *tmpbuf;
asprintf(&tmpbuf, "@Base.help %s", buf+1);
asprintf(&tmpbuf, buf[0] == '?' ? "@Base.help %s" :
"@Base.methods %s", buf+1);
jl_value_t *v = jl_parse_input_line(tmpbuf);
free(tmpbuf);
return v;
Expand Down