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

Same fs #204

Merged
merged 2 commits into from
Jun 26, 2023
Merged
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
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ You can think of `erdtree` as a little bit of `du`, `tree`, `find`, `wc` and `ls
- [Redirecting output and colorization](#redirecting-output-and-colorization)
- [Parallelism](#parallelism)
- [Completions](#completions)
- [Same filesystem](#same-filesystem)
* [Comparisons against similar programs](#comparisons-against-similar-programs)
- [exa](#exa)
- [dua](#dua)
@@ -72,6 +73,9 @@ Arguments:
Directory to traverse; defaults to current working directory

Options:
-c, --config <CONFIG>
Use configuration of named table rather than the top-level table in .erdtree.toml

-C, --color <COLOR>
Mode of coloring output

@@ -200,7 +204,7 @@ Options:
-T, --threads <THREADS>
Number of threads to use

[default: 3]
[default: 10]

-u, --unit <UNIT>
Report disk usage in binary or SI units
@@ -211,6 +215,9 @@ Options:
- bin: Displays disk usage using binary prefixes
- si: Displays disk usage using SI prefixes

-x, --one-file-system
Prevent traversal into directories that are on different filesystems

-y, --layout <LAYOUT>
Which kind of layout to use when rendering the output

@@ -800,6 +807,15 @@ $ et --completions zsh > ~/.oh-my-zsh/completions/_erd
$ source ~/.zshrc
```

### Same filesystem

If you are traversing a directory that contains mount points to other filesystems that you do not wish to traverse, use the following:

```
-x, --one-file-system
Prevent traversal into directories that are on different filesystems
```

## Rules for contributing

For rules on how to contribute please refer to [CONTRIBUTING.md](CONTRIBUTING.md).
4 changes: 4 additions & 0 deletions src/context/mod.rs
Original file line number Diff line number Diff line change
@@ -158,6 +158,10 @@ pub struct Context {
#[arg(short, long, value_enum, default_value_t)]
pub unit: PrefixKind,

/// Prevent traversal into directories that are on different filesystems
#[arg(short = 'x', long = "one-file-system")]
pub same_fs: bool,

/// Which kind of layout to use when rendering the output
#[arg(short = 'y', long, value_enum, default_value_t)]
pub layout: layout::Type,
1 change: 1 addition & 0 deletions src/tree/mod.rs
Original file line number Diff line number Diff line change
@@ -436,6 +436,7 @@ impl TryFrom<&Context> for WalkParallel {
.git_ignore(!ctx.no_ignore)
.hidden(!ctx.hidden)
.overrides(ctx.no_git_override()?)
.same_file_system(ctx.same_fs)
.threads(ctx.threads);

if ctx.suppress_size && ctx.level() == 1 {