diff --git a/README.md b/README.md index 8012be23..f8f613c2 100644 --- a/README.md +++ b/README.md @@ -126,11 +126,11 @@ Usage: `aderyn [OPTIONS] ` ``: The path to the root of the codebase to be analyzed. Defaults to the current directory. Options: - - `-s`, `--src`: Path to the source contracts. If not provided, or if aderyn can't find famous files to read (like `foundry.toml`, which it automatically searches for) the ROOT directory will be used. + - `-s`, `--src`: Path to the source contracts. Used to avoid analyzing libraries, tests or scripts and focus on the contracts. If not provided, or if aderyn can't find famous files to read (like `foundry.toml`, which it automatically searches for) the ROOT directory will be used. - In foundry projects, this is usually the `src/` folder unless stated otherwise in `foundry.toml`. - In Hardhat projects, this is usually the `contracts/` folder unless stated otherwise in the config. - - `-i`, `--path-includes `: List of path strings to include, delimited by comma (no spaces). Any solidity file path not containing these strings will be ignored - - `-x`, `--path-excludes `: List of path strings to exclude, delimited by comma (no spaces). Any solidity file path containing these strings will be ignored + - `-i`, `--path-includes `: List of path strings to include, delimited by comma (no spaces). It allows to include only one or more specific contracts in the analysis. Any solidity file path not containing these strings will be ignored. + - `-x`, `--path-excludes `: List of path strings to exclude, delimited by comma (no spaces). It allows to exclude one or more specific contracts from the analysis. Any solidity file path containing these strings will be ignored - `-o`, `--output `: Desired file path for the final report (will overwrite the existing one) [default: report.md] - `-n`, `--no-snippets`: Do not include code snippets in the report (reduces report size in large repos) - `-h`, `--help`: Print help diff --git a/aderyn/README.md b/aderyn/README.md index 43a3c4e9..34276632 100644 --- a/aderyn/README.md +++ b/aderyn/README.md @@ -132,11 +132,11 @@ Usage: `aderyn [OPTIONS] ` ``: The path to the root of the codebase to be analyzed. Defaults to the current directory. Options: - - `-s`, `--src`: Path to the source contracts. If not provided, or if aderyn can't find famous files to read (like `foundry.toml`, which it automatically searches for) the ROOT directory will be used. + - `-s`, `--src`: Path to the source contracts. Used to avoid analyzing libraries, tests or scripts and focus on the contracts. If not provided, or if aderyn can't find famous files to read (like `foundry.toml`, which it automatically searches for) the ROOT directory will be used. - In foundry projects, this is usually the `src/` folder unless stated otherwise in `foundry.toml`. - In Hardhat projects, this is usually the `contracts/` folder unless stated otherwise in the config. - - `-i`, `--path-includes `: List of path strings to include, delimited by comma (no spaces). Any solidity file path not containing these strings will be ignored - - `-x`, `--path-excludes `: List of path strings to exclude, delimited by comma (no spaces). Any solidity file path containing these strings will be ignored + - `-i`, `--path-includes `: List of path strings to include, delimited by comma (no spaces). It allows to include only one or more specific contracts in the analysis. Any solidity file path not containing these strings will be ignored. + - `-x`, `--path-excludes `: List of path strings to exclude, delimited by comma (no spaces). It allows to exclude one or more specific contracts from the analysis. Any solidity file path containing these strings will be ignored - `-o`, `--output `: Desired file path for the final report (will overwrite the existing one) [default: report.md] - `-n`, `--no-snippets`: Do not include code snippets in the report (reduces report size in large repos) - `-h`, `--help`: Print help diff --git a/aderyn/src/main.rs b/aderyn/src/main.rs index f0b857aa..7a588f76 100644 --- a/aderyn/src/main.rs +++ b/aderyn/src/main.rs @@ -19,25 +19,31 @@ pub struct CommandLineArgs { #[arg(default_value = ".")] root: String, - /// Path to the source contracts. If not provided, the ROOT directory will be used. + /// Path to the source contracts. + /// Used to avoid analyzing libraries, tests or scripts and focus on the contracts. /// - /// For example, in a foundry repo: + /// In Foundry projects, it's auto-captured by foundry.toml and it's usually + /// not necessary to provide it. /// - /// --src=src/ - /// - /// In a hardhat repo: + /// In a Hardhat project: /// /// --src=contracts/ #[clap(short, long, use_value_delimiter = true)] src: Option>, /// List of path strings to include, delimited by comma (no spaces). - /// Any solidity file path not containing these strings will be ignored + /// + /// It allows to include only one or more specific contracts in the analysis: + /// aderyn -i src/MyContract.sol + /// aderyn -i src/MyContract.sol,src/MyOtherContract.sol #[clap(short = 'i', long, use_value_delimiter = true)] path_includes: Option>, /// List of path strings to exclude, delimited by comma (no spaces). - /// Any solidity file path containing these strings will be ignored + /// + /// It allows to exclude one or more specific contracts from the analysis: + /// aderyn -x src/MyContract.sol + /// aderyn -x src/MyContract.sol,src/MyOtherContract.sol #[clap(short = 'x', long, use_value_delimiter = true)] path_excludes: Option>,