This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
10 changed files
with
79 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters