-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
The output of cast help/forge help and -h/--help is, in some cases, very large and not super helpful. I attempted to address some of it in #1268, but there are still improvements we can make:
Remove opts that are not used by commands
We should try to split the opts structs more, so we only pull in what we need.
forge run- Does not use the following from
BuildArgs:-d/--delay--extra-output--extra-output-files--force--ignored-error-codes--names--no-restart-o/--out--run-all--sizes-w/--watch-c/--contracts(?)--cache-path(?)
- Does not use the following from
forge tree- Does not use the following from
BuildArgs:-d/--delay--evm-version--extra-output--extra-output-files--force--ignored-error-codes--libraries--names--no-auto-detect--no-restart-o/--out--offline--optimize--optimize-runs--run-all--sizes--use--via-ir-w/--watch
- Does not use the following from
forge config- I'm not sure why there are so many options in this command (cc @mattsse)
forge create- Does not use the following from
BuildArgs:-d/--delay--evm-version--extra-output--extra-output-files--ignored-error-codes--names--no-restart--run-all--sizes--use-w/--watch
- Does not use the following from
forge test- Does not use the following from
BuildArgs:--extra-output--extra-output-files--names(it can, but should it?)--sizes(it can, but should it?)
- Does not use the following from
cast estimate- Does not use the following from
EthereumOpts:- Any of the
Walletoptions
- Any of the
- Does not use the following from
cast access-list- Only uses
--etherscan-api-keyand--chainfromEthereumOpts
- Only uses
Use next_help_heading
We should use next_help_heading to logically group options. Since options are alphabetically sorted, some options you care about more (i.e. options for the specific command) might be placed next to options that you may not care about as much.
As an example, for forge tree, --no-dedupe is next to --no-restart and --names (two options we do not care about at all in this case).
Merge commands with common functionality
forge test --gas-reportandforge snapshotserve somewhat similar purposes. I know we've talked about potentially merging these, so I'm including it here.cast --calldata-decodeandcast 4byte-decodecould be merged intocast --calldata-decode --4byteor similarcast --to-weiandcast --to-unitshould be merged since the default behavior forcast --to-unitis exactly whatcast --to-weiis doingcast --concat-hexduplicates functionality incast --to-hexdatacast wallet vanitycould be merged intocast wallet new --vanity
These lists are non-exhaustive - I haven't checked everything
Metadata
Metadata
Assignees
Labels
Type
Projects
Status