Add basic help "command" to InteractiveUtils #41749
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add basic help "command" to InteractiveUtils
Typing "help" into an interactive command line program is an intuitive step to take when working with a new program. This pull request creates a "help" command by creating a singleton
Help
object in InteractiveUtils and a constant instancehelp
.While this has some redundancy with
?
(mentioned in the banner) and@doc
, the redundancy is worthwhile to make Julia user friendly and assists the users when the banner may not be visible after executing several commands.Background
Julia before this pull request
Currently, typing "help" into the Julia REPL results in an error message.
Pkg help
In contrast, the Pkg mode:
Python
Compare this to Python/ipython:
R
While
Base.banner()
does direct users to?
Implementation Notes
Help
struct.Base.show
is implemented forHelp
by showing the result ofBase.Docs.parsedoc(Base.Docs.keywords[:help])
@doc(help)
seems to fail@doc
.