Skip to content

Commit

Permalink
chore: Update cli docs with forge init (#193)
Browse files Browse the repository at this point in the history
* chore: update cli README.md

* chore: cleanup cli docs and structopt
  • Loading branch information
wolflo authored Dec 3, 2021
1 parent 0527eb9 commit 6cdecf2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
14 changes: 10 additions & 4 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ FLAGS:
SUBCOMMANDS:
build build your smart contracts
clean removes the build artifacts and cache directories completions
create deploy a compiled contract
help Prints this message or the help of the given subcommand(s)
init initializes a new forge sample repository
install installs one or more dependencies as git submodules
remappings prints the automatically inferred remappings for this repository
test test your smart contracts
Expand All @@ -48,6 +50,7 @@ USAGE:
forge build [FLAGS] [OPTIONS]
FLAGS:
--force force recompilation of the project, deletes the cache and artifacts folders
-h, --help Prints help information
--no-auto-detect if set to true, skips auto-detecting solc and uses what is in the user's $PATH
-V, --version Prints version information
Expand All @@ -60,8 +63,7 @@ OPTIONS:
-o, --out <out-path> path to where the contract artifacts are stored
-r, --remappings <remappings>... the remappings
--remappings-env <remappings-env> [env: DAPP_REMAPPINGS=]
--root <root> the project's root path, default being the current directory [default:
std::env::current_dir().unwrap()]
--root <root> the project's root path, default being the current working directory
```

By default, it will auto-detect the solc pragma version requirement per-file and
Expand All @@ -71,7 +73,7 @@ that satisfies the requirement, (e.g. `pragma solidity >=0.7.0 <0.8.0` will use
`forge build --no-auto-detect`, and it'll use whichever `solc` version is in
your `$PATH`.

The project's root directory defaults to the current directory, assuming
The project's root directory defaults to the current working directory, assuming
contracts are under `src/` and `lib/`, but can also be configured via the
`--root`, `--lib-paths` and `--contracts` arguments. The contracts and libraries
directories are assumed to be relative to the project root, for example
Expand Down Expand Up @@ -112,12 +114,16 @@ USAGE:
FLAGS:
--ffi enables the FFI cheatcode
--force force recompilation of the project, deletes the cache and artifacts folders
-h, --help Prints help information
-j, --json print the test results in json format
--no-auto-detect if set to true, skips auto-detecting solc and uses what is in the user's $PATH
-V, --version Prints version information
OPTIONS:
--allow-failure <allow-failure>
if set to true, the process will exit with an exit code = 0, even if the tests fail [env:
FORGE_ALLOW_FAILURE=]
--block-base-fee-per-gas <block-base-fee-per-gas> the base fee in a block [default: 0]
--block-coinbase <block-coinbase>
the block.coinbase value during EVM execution [default: 0x0000000000000000000000000000000000000000]
Expand Down Expand Up @@ -157,7 +163,7 @@ OPTIONS:
-r, --remappings <remappings>... the remappings
--remappings-env <remappings-env> [env: DAPP_REMAPPINGS=]
--root <root>
the project's root path, default being the current directory [default: std::env::current_dir().unwrap()]
the project's root path, default being the current working directory
--sender <sender>
the address which will be executing all tests [env: DAPP_TEST_ADDRESS=] [default:
Expand Down
10 changes: 5 additions & 5 deletions cli/src/forge_opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pub enum Subcommands {
about = "prints the automatically inferred remappings for this repository"
)]
Remappings {
#[structopt(help = "the project's root path, default being the current directory", long)]
#[structopt(help = "the project's root path, default being the current working directory", long)]
root: Option<PathBuf>,
#[structopt(help = "the paths where your libraries are installed", long)]
lib_paths: Vec<PathBuf>,
Expand All @@ -139,9 +139,9 @@ pub enum Subcommands {
verify: bool,
},

#[structopt(alias = "i", about = "initializes a new forge repository")]
#[structopt(alias = "i", about = "initializes a new forge sample repository")]
Init {
#[structopt(help = "the project's root path, default being the current directory")]
#[structopt(help = "the project's root path, default being the current working directory")]
root: Option<PathBuf>,
#[structopt(help = "optional solidity template to start from", long, short)]
template: Option<String>,
Expand All @@ -154,7 +154,7 @@ pub enum Subcommands {

#[structopt(about = "removes the build artifacts and cache directories")]
Clean {
#[structopt(help = "the project's root path, default being the current directory", long)]
#[structopt(help = "the project's root path, default being the current working directory", long)]
root: Option<PathBuf>,
},
}
Expand Down Expand Up @@ -289,7 +289,7 @@ impl std::convert::TryFrom<&BuildOpts> for Project {

#[derive(Debug, StructOpt)]
pub struct BuildOpts {
#[structopt(help = "the project's root path, default being the current directory", long)]
#[structopt(help = "the project's root path, default being the current working directory", long)]
pub root: Option<PathBuf>,

#[structopt(
Expand Down

0 comments on commit 6cdecf2

Please sign in to comment.