Skip to content
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

Docs/improve documentation for cli options. #763

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ Usage: `aderyn [OPTIONS] <ROOT>`
`<ROOT>`: 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 <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 <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 <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 <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 <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
Expand Down
6 changes: 3 additions & 3 deletions aderyn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ Usage: `aderyn [OPTIONS] <ROOT>`
`<ROOT>`: 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 <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 <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 <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 <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 <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
Expand Down
20 changes: 13 additions & 7 deletions aderyn/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<String>>,

/// 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<Vec<String>>,

/// 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<Vec<String>>,

Expand Down
Loading