foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.16k stars 1.69k forks source link

Feature: Examples for CLI #2401

Open sambacha opened 2 years ago

sambacha commented 2 years ago

Component

Forge, Cast, Anvil

Describe the feature you would like

Add Examples in CLI

This is from GitHub's CLI, it offers examples as well as a reference back to their documentation.

Forge/Cast should include this, especially when introducing new CLI arguments/commands

EXAMPLES
  $ gh issue create --title "I found a bug" --body "Nothing works"
  $ gh issue create --label "bug,help wanted"
  $ gh issue create --label bug --label "help wanted"
  $ gh issue create --assignee monalisa,hubot
  $ gh issue create --assignee "@me"
  $ gh issue create --project "Roadmap"

LEARN MORE
  Use 'gh <command> <subcommand> --help' for more information about a command.
  Read the manual at https://cli.github.com/manual

Additional context

part of https://github.com/foundry-rs/foundry/issues/2396

abheektripathy commented 1 year ago

hey @sambacha, would like to work on this, if it's available.

also, for it's implementation, im planning to adding out some examples here somewhat like this(but for new updates/some most used commands)

EXAMPLES:
$ forge compile [complies your smart contract]
$ forge test -vv [complies your smart contract and runs all written tests]
$ forge test --gas-report [generates a gas report for your tests]

here below usage preferably,

Screenshot 2023-05-31 at 1 33 31 AM
zerosnacks commented 1 month ago

Hi @abheektripathy would you still be interested in working on this? I can see this being useful