-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cast): add an unformatted output mode #6600
Comments
I agree cast in general needs some cleanup, I suspect there's a lot of other inconsistencies. To start, I think the default return values from |
I think that the defaults should be human friendly, as it is now. When the user manually executes a command, they probably won't remember, won't bother to type or simply won't have the knowledge to add the extra parameter, and they will be stuck with the unfriendly output. Scripts on the other hands are written with more care and preparation, and usually only once, so adding a flag won't be that annoying. |
I don't feel strongly here, but AFAIK this was a breaking change which is why it should be reverted. Once we have a v1, we can make the default change to human friendly at that point. Other commands like |
In general, tools should default to use |
Agreed that human readable is a better default, but will defer to forge maintainers if they're ok with the pre-v1 breaking change that would be required to keep consistency across commands |
Adding this ticket to #8794
If you see specific areas that are lacking or run into issues please let me know |
Hi @CodeSandwich thanks for opening this Since recently we've introduced the If you see any commands that you would like to have this output mode for please open a ticket for each, we will prioritize these. Marking this as |
Component
Other (please describe)
Describe the feature you would like
Foundry is a great tool for running operations manually, but it's sometimes problematic to automate. The main problem is the output format, it's tailored for reading, so it often needs extra processing, and it sometimes changes to further improve readability. Some examples of problems I've encountered when writing scripts using foundry:
cast call
to a function returning a string prints its value in quotes, which need to be strippedcast call
to a function returning a number may or may not print the output twice, the second time in the scientific notation (see cast call returns integers in scientific notation #6598)forge create
prints the whole deployment report with the transaction hash, the deployer address and the compilation result, but scripts usually only need the deployed address, which needs to be extractedIt would be great to have a mode that would keep the output simple and stable for the automation, with no decorations for easier reading.
Some commands have the
--json
option, for exampleforge create
. It's inconvenient, because it requires piping the output through ajq
script, but it's a viable workaround. This option isn't available everywhere, for examplecast call
doesn't support it.Additional context
No response
The text was updated successfully, but these errors were encountered: