You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
Restrict general help content in REPL context (#5885)
Restrict general help in REPL context
General help can be requested in 2 contexts, the command line, and a REPL, both having a different set of valid truffle commands. This commit 1) moves the source of truth for valid, excluded (in REPL) and valid REPL commands to a single module. 2) modifies the `displayGeneralHelp` function to be context aware and display the appropriate help. 3) Updates tests and webpack to use the new source of truth.
## packages/core/lib/commands/commands.js
- define the single source of truth for valid, excluded and console only
truffle commands that is easy to maintain.
## packages/core/lib/command-utils.js
- update logic to use the single source of truth
- modify `displayGeneralHelp()` to accept a flag specifying whether it is run in a REPL. If in a REPL, the logic will show help for console-only truffle commands.
## packages/core/lib/commands/console/run.js
- use command source of truth instead of calculating
## packages/core/lib/commands/develop/run.js
- use command source of truth instead of calculating
## packages/core/lib/console-child.js
- modify `displayGeneralHelp()` to accept an `isREPL` option, which is used to display help for REPL commands or command line commands.
## packages/core/lib/console.js
- refactor to use truffle command source of truth and modified error messages for using excluded and invalid commands in the REPL
## misc
- packages/core/test/commands.js
- packages/core/test/lib/console.js
- packages/truffle/webpack.config.js
- refactor to use command source of truth.
0 commit comments