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

Improve documentation for --only flag #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ Within the [Discourse codebase], for example, here's what the output might look
Additionally, you can limit results by substring with the `--only` flag, or
modify paths to ignore with `--ignore`.

```sh
// This filters the .rs files inside all directories and outputs scores in a json format
complexity --format json --only .rs

// This filters the .rs and .md files inside all directories
complexity --only .rs,.md

// This filters all the files inside src/scoring directory
complexity --only src/scoring
```

You can view the full suite of options by running `complexity help`.

## License
Expand Down
2 changes: 2 additions & 0 deletions src/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ pub struct Flags {
/// Only files/directories matching the provided value
///
/// This supports providing multiple values with a comma-delimited list
///
/// Example: --only .rs,.md
#[clap(long, value_delimiter = ',')]
pub only: Vec<String>,

Expand Down
Loading