2 unstable releases

new 0.8.0 Sep 18, 2024
0.7.0 Sep 9, 2024

#437 in Filesystem

Download history 86/week @ 2024-09-04 39/week @ 2024-09-11

125 downloads per month

MIT and maybe CC-PDDC

54KB
345 lines

nu_plugin_jwalk

jwalk is an experimental nushell plugin that uses the jwalk crate.

Usage:

❯ jwalk --help
View jwalk results of walking the path.

Usage:
  > jwalk {flags} <path>

Flags:
  -h, --help - Display the help message for this command
  -v, --verbose - run in verbose mode with multi-column output
  -s, --sort - sort by file name
  -c, --custom - custom hard-coded walker with process_read_dir
  -k, --skip-hidden - skip hidden files
  -f, --follow-links - follow symbolic links
  -d, --debug - print performance metrics at the end of the table
  -m, --min-depth <Int> - minimum depth to search
  -x, --max-depth <Int> - maximum depth to search
  -t, --threads <Int> - number of rayon threads to use

Parameters:
  path <string>: path to jwalk

Examples:
  Walk the process working directory in debug mode with 2 threads and max depth of 1
  > jwalk --debug --max-depth 1 --threads 2 (pwd)

  Walk the process working directory in debug mode with 2 threads and max depth of 1 using verbose
  > jwalk --debug --verbose --max-depth 1 --threads 2 (pwd)

Examples

Example 1

jwalk with one column output, with debug info using 4 threads and a max depth of 1

❯ jwalk c:\Users\username\source\repos\forks\nushell --debug --threads 4 --max-depth 1
╭────┬──────────────────────────────────────────────────────────────────╮
│  0 │ c:\Users\username\source\repos\forks\nushell                     │
│  1 │ c:\Users\username\source\repos\forks\nushell\.cargo              │
│  2 │ c:\Users\username\source\repos\forks\nushell\.git                │
│  3 │ c:\Users\username\source\repos\forks\nushell\.gitattributes      │
│  4 │ c:\Users\username\source\repos\forks\nushell\.githooks           │
│  5 │ c:\Users\username\source\repos\forks\nushell\.github             │
│  6 │ c:\Users\username\source\repos\forks\nushell\.gitignore          │
│  7 │ c:\Users\username\source\repos\forks\nushell\.vscode             │
│  8 │ c:\Users\username\source\repos\forks\nushell\assets              │
│  9 │ c:\Users\username\source\repos\forks\nushell\benches             │
│ 10 │ c:\Users\username\source\repos\forks\nushell\Cargo.lock          │
│ 11 │ c:\Users\username\source\repos\forks\nushell\Cargo.toml          │
│ 12 │ c:\Users\username\source\repos\forks\nushell\CITATION.cff        │
│ 13 │ c:\Users\username\source\repos\forks\nushell\CODE_OF_CONDUCT.md  │
│ 14 │ c:\Users\username\source\repos\forks\nushell\CONTRIBUTING.md     │
│ 15 │ c:\Users\username\source\repos\forks\nushell\crates              │
│ 16 │ c:\Users\username\source\repos\forks\nushell\Cross.toml          │
│ 17 │ c:\Users\username\source\repos\forks\nushell\devdocs             │
│ 18 │ c:\Users\username\source\repos\forks\nushell\docker              │
│ 19 │ c:\Users\username\source\repos\forks\nushell\LICENSE             │
│ 20 │ c:\Users\username\source\repos\forks\nushell\README.md           │
│ 21 │ c:\Users\username\source\repos\forks\nushell\rust-toolchain.toml │
│ 22 │ c:\Users\username\source\repos\forks\nushell\scripts             │
│ 23 │ c:\Users\username\source\repos\forks\nushell\src                 │
│ 24 │ c:\Users\username\source\repos\forks\nushell\target              │
│ 25 │ c:\Users\username\source\repos\forks\nushell\tests               │
│ 26 │ c:\Users\username\source\repos\forks\nushell\toolkit.nu          │
│ 27 │ c:\Users\username\source\repos\forks\nushell\typos.toml          │
│ 28 │ c:\Users\username\source\repos\forks\nushell\wix                 │
│ 29 │ Running with these options:                                      │
│    │   sort: false                                                    │
│    │   skip_hidden: false                                             │
│    │   follow_links: false                                            │
│    │   min_depth: 0                                                   │
│    │   max_depth: 1                                                   │
│    │   threads: Some(4)                                               │
│    │ Time: 1.0024ms                                                   │
╰────┴──────────────────────────────────────────────────────────────────╯

Example 2

jwalk with multi-column output and debug info with 4 threads and a max depth of 1

❯ jwalk . --debug --max-depth 1 --threads 2 --verbose
╭─#──┬────depth────┬────client_state────┬──file_name───┬─full_path─┬─is_dir─┬─is_file─┬─is_symlink─┬─parent_path─┬path_is_symlink┬─accessed─┬─created─┬─modified─┬─size─┬readonly╮
│ 00false              │ nushell      │ /Users/fd │ truefalsefalse/Users/fdnc │ false         │ an hour  │ a year  │ an hour  │ 1056false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src     │               │ ago      │ ago     │ ago      │      │        │
│    │             │                    │              │ /nushell  │        │         │            │             │               │          │         │          │      │        │
│ 11falseCODE_OF_COND/Users/fd │ falsetruefalse/Users/fdnc │ false         │ a year   │ a year  │ a year   │ 3444false  │
│    │             │                    │ UCT.md       │ ncred/src │        │         │            │ red/src/nus │               │ ago      │ ago     │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ CODE_OF_C │        │         │            │             │               │          │         │          │      │        │
│    │             │                    │              │ ONDUCT.md │        │         │            │             │               │          │         │          │      │        │
│ 21false              │ Cargo.toml   │ /Users/fd │ falsetruefalse/Users/fdnc │ false         │ a day    │ a day   │ a day    │ 9040false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │ ago     │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ Cargo.tom │        │         │            │             │               │          │         │          │      │        │
│    │             │                    │              │ l         │        │         │            │             │               │          │         │          │      │        │
│ 31false              │ toolkit.nu   │ /Users/fd │ falsetruefalse/Users/fdnc │ false2 months │ 22 months │ 1964false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │  ago     │ months  │  ago     │ 4    │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │ ago     │          │      │        │
│    │             │                    │              │ toolkit.n │        │         │            │             │               │          │         │          │      │        │
│    │             │                    │              │ u         │        │         │            │             │               │          │         │          │      │        │
│ 41false.githooks    │ /Users/fd │ truefalsefalse/Users/fdnc │ false6 months │ 66 months │  128false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │  ago     │ months  │  ago     │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │ ago     │          │      │        │
│    │             │                    │              │ .githooks │        │         │            │             │               │          │         │          │      │        │
│ 51false              │ typos.toml   │ /Users/fd │ falsetruefalse/Users/fdnc │ false3 weeks  │ 3 weeks │ 3 weeks  │  499false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │  ago    │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ typos.tom │        │         │            │             │               │          │         │          │      │        │
│    │             │                    │              │ l         │        │         │            │             │               │          │         │          │      │        │
│ 61false.fleet       │ /Users/fd │ truefalsefalse/Users/fdnc │ false         │ a year   │ a year  │ a year   │   96false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │ ago     │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ .fleet    │        │         │            │             │               │          │         │          │      │        │
│ 71false              │ crates       │ /Users/fd │ truefalsefalse/Users/fdnc │ false         │ a month  │ a year  │ a month  │ 1344false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │ ago     │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ crates    │        │         │            │             │               │          │         │          │      │        │
│ 81false              │ docker       │ /Users/fd │ truefalsefalse/Users/fdnc │ false3 weeks  │ a year  │ 3 weeks  │   96false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │ ago     │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ docker    │        │         │            │             │               │          │         │          │      │        │
│ 91false.DS_Store    │ /Users/fd │ falsetruefalse/Users/fdnc │ false2 weeks  │ 6       │ an hour  │ 6148false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │ months  │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │ ago     │          │      │        │
│    │             │                    │              │ .DS_Store │        │         │            │             │               │          │         │          │      │        │
│ 101falseLICENSE/Users/fd │ falsetruefalse/Users/fdnc │ false6 months │ 66 months │ 1094false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │  ago     │ months  │  ago     │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │ ago     │          │      │        │
│    │             │                    │              │ LICENSE   │        │         │            │             │               │          │         │          │      │        │
│ 111falseCITATION.cff │ /Users/fd │ falsetruefalse/Users/fdnc │ false2 months │ 22 months │  812false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │  ago     │ months  │  ago     │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │ ago     │          │      │        │
│    │             │                    │              │ CITATION. │        │         │            │             │               │          │         │          │      │        │
│    │             │                    │              │ cff       │        │         │            │             │               │          │         │          │      │        │
│ 121false              │ target       │ /Users/fd │ truefalsefalse/Users/fdnc │ false2 weeks  │ 2 weeks │ 2 weeks  │  224false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │  ago    │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ target    │        │         │            │             │               │          │         │          │      │        │
│ 131false              │ Cross.toml   │ /Users/fd │ falsetruefalse/Users/fdnc │ false5 months │ 55 months │  666false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │  ago     │ months  │  ago     │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │ ago     │          │      │        │
│    │             │                    │              │ Cross.tom │        │         │            │             │               │          │         │          │      │        │
│    │             │                    │              │ l         │        │         │            │             │               │          │         │          │      │        │
│ 141false              │ devdocs      │ /Users/fd │ truefalsefalse/Users/fdnc │ false2 months │ 42 months │  224false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │  ago     │ months  │  ago     │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │ ago     │          │      │        │
│    │             │                    │              │ devdocs   │        │         │            │             │               │          │         │          │      │        │
│ 151false              │ tests        │ /Users/fd │ truefalsefalse/Users/fdnc │ false2 months │ a year  │ 2 months │  544false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │  ago     │ ago     │  ago     │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ tests     │        │         │            │             │               │          │         │          │      │        │
│ 161false              │ Cargo.lock   │ /Users/fd │ falsetruefalse/Users/fdnc │ false         │ a day    │ a day   │ a day    │ 1755false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │ ago     │ ago      │ 80   │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ Cargo.loc │        │         │            │             │               │          │         │          │      │        │
│    │             │                    │              │ k         │        │         │            │             │               │          │         │          │      │        │
│ 171falseREADME.md    │ /Users/fd │ falsetruefalse/Users/fdnc │ false         │ a month  │ a month │ a month  │ 1228false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │  ago    │ ago      │ 3    │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ README.md │        │         │            │             │               │          │         │          │      │        │
│ 181false.cargo       │ /Users/fd │ truefalsefalse/Users/fdnc │ false         │ a month  │ a year  │ a month  │   96false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │ ago     │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ .cargo    │        │         │            │             │               │          │         │          │      │        │
│ 191false.gitignore   │ /Users/fd │ falsetruefalse/Users/fdnc │ false6 months │ 66 months │  660false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │  ago     │ months  │  ago     │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │ ago     │          │      │        │
│    │             │                    │              │ .gitignor │        │         │            │             │               │          │         │          │      │        │
│    │             │                    │              │ e         │        │         │            │             │               │          │         │          │      │        │
│ 201falseCONTRIBUTING/Users/fd │ falsetruefalse/Users/fdnc │ false2 months │ 22 months │ 1122false  │
│    │             │                    │ .md          │ ncred/src │        │         │            │ red/src/nus │               │  ago     │ months  │  ago     │ 4    │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │ ago     │          │      │        │
│    │             │                    │              │ CONTRIBUT │        │         │            │             │               │          │         │          │      │        │
│    │             │                    │              │ ING.md    │        │         │            │             │               │          │         │          │      │        │
│ 211false              │ scripts      │ /Users/fd │ truefalsefalse/Users/fdnc │ false2 weeks  │ 62 weeks  │  416false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │ months  │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │ ago     │          │      │        │
│    │             │                    │              │ scripts   │        │         │            │             │               │          │         │          │      │        │
│ 221false.github      │ /Users/fd │ truefalsefalse/Users/fdnc │ false2 weeks  │ a year  │ 2 weeks  │  224false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │ ago     │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ .github   │        │         │            │             │               │          │         │          │      │        │
│ 231false.gitattribut │ /Users/fd │ falsetruefalse/Users/fdnc │ false6 months │ 66 months │  111false  │
│    │             │                    │ es           │ ncred/src │        │         │            │ red/src/nus │               │  ago     │ months  │  ago     │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │ ago     │          │      │        │
│    │             │                    │              │ .gitattri │        │         │            │             │               │          │         │          │      │        │
│    │             │                    │              │ butes     │        │         │            │             │               │          │         │          │      │        │
│ 241false              │ benches      │ /Users/fd │ truefalsefalse/Users/fdnc │ false2 weeks  │ 62 weeks  │  128false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │ months  │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │ ago     │          │      │        │
│    │             │                    │              │ benches   │        │         │            │             │               │          │         │          │      │        │
│ 251false              │ wix          │ /Users/fd │ truefalsefalse/Users/fdnc │ false2 months │ a year  │ 2 months │  160false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │  ago     │ ago     │  ago     │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ wix       │        │         │            │             │               │          │         │          │      │        │
│ 261false              │ rust-toolcha │ /Users/fd │ falsetruefalse/Users/fdnc │ false2 months │ 22 months │ 1106false  │
│    │             │                    │ in.toml      │ ncred/src │        │         │            │ red/src/nus │               │  ago     │ months  │  ago     │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │ ago     │          │      │        │
│    │             │                    │              │ rust-tool │        │         │            │             │               │          │         │          │      │        │
│    │             │                    │              │ chain.tom │        │         │            │             │               │          │         │          │      │        │
│    │             │                    │              │ l         │        │         │            │             │               │          │         │          │      │        │
│ 271false.mailmap     │ /Users/fd │ falsetruefalse/Users/fdnc │ false4 months │ 2 years │ 4 months │ 2036false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │  ago     │  ago    │  ago     │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ .mailmap  │        │         │            │             │               │          │         │          │      │        │
│ 281false.git         │ /Users/fd │ truefalsefalse/Users/fdnc │ false         │ an hour  │ a year  │ 2 hours  │  608false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │ ago     │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ .git      │        │         │            │             │               │          │         │          │      │        │
│ 291false.vscode      │ /Users/fd │ truefalsefalse/Users/fdnc │ false         │ a year   │ a year  │ a year   │  128false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │ ago     │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ .vscode   │        │         │            │             │               │          │         │          │      │        │
│ 301false              │ assets       │ /Users/fd │ truefalsefalse/Users/fdnc │ false6 months │ a year  │ 6 months │  160false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │  ago     │ ago     │  ago     │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ assets    │        │         │            │             │               │          │         │          │      │        │
│ 311false              │ src          │ /Users/fd │ truefalsefalse/Users/fdnc │ false         │ a week   │ a year  │ a week   │  384false  │
│    │             │                    │              │ ncred/src │        │         │            │ red/src/nus │               │ ago      │ ago     │ ago      │      │        │
│    │             │                    │              │ /nushell/ │        │         │            │ hell        │               │          │         │          │      │        │
│    │             │                    │              │ src       │        │         │            │             │               │          │         │          │      │        │
│ 32 │ sort: false │ skip_hidden: false │ follow_links │ min_depth │ max_de │ threads │ time:      │          ❎ │            ❎ │       ❎ │      ❎ │       ❎ │   ❎ │     ❎ │
│    │             │                    │ : false: 0       │ pth: 1: 2612.834µs  │             │               │          │         │          │      │        │
╰─#──┴────depth────┴────client_state────┴──file_name───┴─full_path─┴─is_dir─┴─is_file─┴─is_symlink─┴─parent_path─┴─path_is_symli─┴─accessed─┴─created─┴─modified─┴─size─┴─readon─╯

Dependencies

~25–58MB
~1M SLoC