-
Notifications
You must be signed in to change notification settings - Fork 2k
du: add -l/--long flag, remove -a/--all flag
#14407
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
Conversation
|
@WieeRd commented on the original request:
Wanted to put it over here to see what others think. I can see benefits around either option, personally. |
|
Two reasons why I think
|
|
@WieeRd Thanks, it makes sence to me. Can you provide a description text for |
|
@WindSoilder I just realized a mildly inconvenient fact. I only checked Well this is awkward. |
|
I think a better solution minght be: removing short flag of |
|
I agree, |
|
I have a question about the existing flag How will/should Also, two slightly off-topic complaints on the
|
I think nushell needs to treat
I agree with you, maybe renaming from |
|
Technically, Nushell has all the rights to make breaking changes whenever it feels like it because it is 0ver. So in conclusion, this PR is going to:
Correct? |
|
Yeah, in addition:
It only enables |
-l flag to du-r/--recursive flag, rename -a/--all to -f/--file
|
I'm confused by this PR. The apparent and physical totals below are all the same. What's the point of using ❯ du -f
╭─#──┬──────────────────────path──────────────────────┬─apparent─┬─physical─┬──────files──────╮
│ 0 │ /Users/fdncred/src/nushell/.DS_Store │ 6.1 KB │ 8.2 KB │ │
│ 1 │ /Users/fdncred/src/nushell/.cargo │ 1.2 KB │ 4.1 KB │ [table 1 row] │
│ 2 │ /Users/fdncred/src/nushell/.git │ 79.8 MB │ 92.9 MB │ [table 8 rows] │
│ 3 │ /Users/fdncred/src/nushell/.gitattributes │ 111 B │ 4.1 KB │ │
│ 4 │ /Users/fdncred/src/nushell/.githooks │ 281 B │ 8.2 KB │ [table 2 rows] │
│ 5 │ /Users/fdncred/src/nushell/.github │ 40.2 KB │ 81.9 KB │ [table 2 rows] │
│ 6 │ /Users/fdncred/src/nushell/.gitignore │ 660 B │ 4.1 KB │ │
│ 7 │ /Users/fdncred/src/nushell/.mailmap │ 2.2 KB │ 4.1 KB │ │
│ 8 │ /Users/fdncred/src/nushell/CITATION.cff │ 812 B │ 4.1 KB │ │
│ 9 │ /Users/fdncred/src/nushell/CODE_OF_CONDUCT.md │ 3.4 KB │ 4.1 KB │ │
│ 10 │ /Users/fdncred/src/nushell/CONTRIBUTING.md │ 11.2 KB │ 12.3 KB │ │
│ 11 │ /Users/fdncred/src/nushell/Cargo.lock │ 186.4 KB │ 188.4 KB │ │
│ 12 │ /Users/fdncred/src/nushell/Cargo.toml │ 9.3 KB │ 12.3 KB │ │
│ 13 │ /Users/fdncred/src/nushell/Cross.toml │ 666 B │ 4.1 KB │ │
│ 14 │ /Users/fdncred/src/nushell/LICENSE │ 1.1 KB │ 4.1 KB │ │
│ 15 │ /Users/fdncred/src/nushell/README.md │ 12.3 KB │ 16.4 KB │ │
│ 16 │ /Users/fdncred/src/nushell/SECURITY.md │ 2.7 KB │ 4.1 KB │ │
│ 17 │ /Users/fdncred/src/nushell/assets │ 1.3 MB │ 1.3 MB │ [table 2 rows] │
│ 18 │ /Users/fdncred/src/nushell/benches │ 14.0 KB │ 20.5 KB │ [table 2 rows] │
│ 19 │ /Users/fdncred/src/nushell/crates │ 9.5 MB │ 13.2 MB │ [table 1 row] │
│ 20 │ /Users/fdncred/src/nushell/devdocs │ 18.2 KB │ 28.7 KB │ [table 5 rows] │
│ 21 │ /Users/fdncred/src/nushell/docker │ 8.6 KB │ 16.4 KB │ [table 3 rows] │
│ 22 │ /Users/fdncred/src/nushell/rust-toolchain.toml │ 1.1 KB │ 4.1 KB │ │
│ 23 │ /Users/fdncred/src/nushell/scripts │ 13.6 KB │ 45.1 KB │ [table 11 rows] │
│ 24 │ /Users/fdncred/src/nushell/src │ 97.8 KB │ 118.8 KB │ [table 10 rows] │
│ 25 │ /Users/fdncred/src/nushell/target │ 20.0 GB │ 20.3 GB │ [table 2 rows] │
│ 26 │ /Users/fdncred/src/nushell/tests │ 687.2 KB │ 1.5 MB │ [table 1 row] │
│ 27 │ /Users/fdncred/src/nushell/toolkit.nu │ 19.7 KB │ 20.5 KB │ │
│ 28 │ /Users/fdncred/src/nushell/typos.toml │ 513 B │ 4.1 KB │ │
│ 29 │ /Users/fdncred/src/nushell/wix │ 24.2 KB │ 32.8 KB │ [table 3 rows] │
╰─#──┴──────────────────────path──────────────────────┴─apparent─┴─physical─┴──────files──────╯
❯ du -r 832 08:24:44 AM
╭─#──┬──────────────────────path──────────────────────┬─apparent─┬─physical─┬───directories───╮
│ 0 │ /Users/fdncred/src/nushell/.DS_Store │ 6.1 KB │ 8.2 KB │ │
│ 1 │ /Users/fdncred/src/nushell/.cargo │ 1.2 KB │ 4.1 KB │ │
│ 2 │ /Users/fdncred/src/nushell/.git │ 79.8 MB │ 92.9 MB │ [table 5 rows] │
│ 3 │ /Users/fdncred/src/nushell/.gitattributes │ 111 B │ 4.1 KB │ │
│ 4 │ /Users/fdncred/src/nushell/.githooks │ 281 B │ 8.2 KB │ │
│ 5 │ /Users/fdncred/src/nushell/.github │ 40.2 KB │ 81.9 KB │ [table 3 rows] │
│ 6 │ /Users/fdncred/src/nushell/.gitignore │ 660 B │ 4.1 KB │ │
│ 7 │ /Users/fdncred/src/nushell/.mailmap │ 2.2 KB │ 4.1 KB │ │
│ 8 │ /Users/fdncred/src/nushell/CITATION.cff │ 812 B │ 4.1 KB │ │
│ 9 │ /Users/fdncred/src/nushell/CODE_OF_CONDUCT.md │ 3.4 KB │ 4.1 KB │ │
│ 10 │ /Users/fdncred/src/nushell/CONTRIBUTING.md │ 11.2 KB │ 12.3 KB │ │
│ 11 │ /Users/fdncred/src/nushell/Cargo.lock │ 186.4 KB │ 188.4 KB │ │
│ 12 │ /Users/fdncred/src/nushell/Cargo.toml │ 9.3 KB │ 12.3 KB │ │
│ 13 │ /Users/fdncred/src/nushell/Cross.toml │ 666 B │ 4.1 KB │ │
│ 14 │ /Users/fdncred/src/nushell/LICENSE │ 1.1 KB │ 4.1 KB │ │
│ 15 │ /Users/fdncred/src/nushell/README.md │ 12.3 KB │ 16.4 KB │ │
│ 16 │ /Users/fdncred/src/nushell/SECURITY.md │ 2.7 KB │ 4.1 KB │ │
│ 17 │ /Users/fdncred/src/nushell/assets │ 1.3 MB │ 1.3 MB │ [table 1 row] │
│ 18 │ /Users/fdncred/src/nushell/benches │ 14.0 KB │ 20.5 KB │ │
│ 19 │ /Users/fdncred/src/nushell/crates │ 9.5 MB │ 13.2 MB │ [table 39 rows] │
│ 20 │ /Users/fdncred/src/nushell/devdocs │ 18.2 KB │ 28.7 KB │ │
│ 21 │ /Users/fdncred/src/nushell/docker │ 8.6 KB │ 16.4 KB │ │
│ 22 │ /Users/fdncred/src/nushell/rust-toolchain.toml │ 1.1 KB │ 4.1 KB │ │
│ 23 │ /Users/fdncred/src/nushell/scripts │ 13.6 KB │ 45.1 KB │ │
│ 24 │ /Users/fdncred/src/nushell/src │ 97.8 KB │ 118.8 KB │ │
│ 25 │ /Users/fdncred/src/nushell/target │ 20.0 GB │ 20.3 GB │ [table 4 rows] │
│ 26 │ /Users/fdncred/src/nushell/tests │ 687.2 KB │ 1.5 MB │ [table 14 rows] │
│ 27 │ /Users/fdncred/src/nushell/toolkit.nu │ 19.7 KB │ 20.5 KB │ │
│ 28 │ /Users/fdncred/src/nushell/typos.toml │ 513 B │ 4.1 KB │ │
│ 29 │ /Users/fdncred/src/nushell/wix │ 24.2 KB │ 32.8 KB │ │
╰─#──┴──────────────────────path──────────────────────┴─apparent─┴─physical─┴───directories───╯
❯ du 519 08:25:10 AM
╭─#──┬──────────────────────path──────────────────────┬─apparent─┬─physical─╮
│ 0 │ /Users/fdncred/src/nushell/.DS_Store │ 6.1 KB │ 8.2 KB │
│ 1 │ /Users/fdncred/src/nushell/.cargo │ 1.2 KB │ 4.1 KB │
│ 2 │ /Users/fdncred/src/nushell/.git │ 79.8 MB │ 92.9 MB │
│ 3 │ /Users/fdncred/src/nushell/.gitattributes │ 111 B │ 4.1 KB │
│ 4 │ /Users/fdncred/src/nushell/.githooks │ 281 B │ 8.2 KB │
│ 5 │ /Users/fdncred/src/nushell/.github │ 40.2 KB │ 81.9 KB │
│ 6 │ /Users/fdncred/src/nushell/.gitignore │ 660 B │ 4.1 KB │
│ 7 │ /Users/fdncred/src/nushell/.mailmap │ 2.2 KB │ 4.1 KB │
│ 8 │ /Users/fdncred/src/nushell/CITATION.cff │ 812 B │ 4.1 KB │
│ 9 │ /Users/fdncred/src/nushell/CODE_OF_CONDUCT.md │ 3.4 KB │ 4.1 KB │
│ 10 │ /Users/fdncred/src/nushell/CONTRIBUTING.md │ 11.2 KB │ 12.3 KB │
│ 11 │ /Users/fdncred/src/nushell/Cargo.lock │ 186.4 KB │ 188.4 KB │
│ 12 │ /Users/fdncred/src/nushell/Cargo.toml │ 9.3 KB │ 12.3 KB │
│ 13 │ /Users/fdncred/src/nushell/Cross.toml │ 666 B │ 4.1 KB │
│ 14 │ /Users/fdncred/src/nushell/LICENSE │ 1.1 KB │ 4.1 KB │
│ 15 │ /Users/fdncred/src/nushell/README.md │ 12.3 KB │ 16.4 KB │
│ 16 │ /Users/fdncred/src/nushell/SECURITY.md │ 2.7 KB │ 4.1 KB │
│ 17 │ /Users/fdncred/src/nushell/assets │ 1.3 MB │ 1.3 MB │
│ 18 │ /Users/fdncred/src/nushell/benches │ 14.0 KB │ 20.5 KB │
│ 19 │ /Users/fdncred/src/nushell/crates │ 9.5 MB │ 13.2 MB │
│ 20 │ /Users/fdncred/src/nushell/devdocs │ 18.2 KB │ 28.7 KB │
│ 21 │ /Users/fdncred/src/nushell/docker │ 8.6 KB │ 16.4 KB │
│ 22 │ /Users/fdncred/src/nushell/rust-toolchain.toml │ 1.1 KB │ 4.1 KB │
│ 23 │ /Users/fdncred/src/nushell/scripts │ 13.6 KB │ 45.1 KB │
│ 24 │ /Users/fdncred/src/nushell/src │ 97.8 KB │ 118.8 KB │
│ 25 │ /Users/fdncred/src/nushell/target │ 20.0 GB │ 20.2 GB │
│ 26 │ /Users/fdncred/src/nushell/tests │ 687.2 KB │ 1.5 MB │
│ 27 │ /Users/fdncred/src/nushell/toolkit.nu │ 19.7 KB │ 20.5 KB │
│ 28 │ /Users/fdncred/src/nushell/typos.toml │ 513 B │ 4.1 KB │
│ 29 │ /Users/fdncred/src/nushell/wix │ 24.2 KB │ 32.8 KB │
╰─#──┴──────────────────────path──────────────────────┴─apparent─┴─physical─╯I agree that its' better to let du without parameters just do a summary and not include the details column. |
|
I agree, actually I'm not really sure what |
|
My suggestion is to have |
|
@fdncred Funny, that was my original request that led to this ;-). I waffle on the It's really just adding two more columns, like we do with |
|
Perhaps we can even remove the distinction between |
|
@WindSoilder Are you going to have time to update this? |
-r/--recursive flag, rename -a/--all to -f/--file-l/--long flag, remove -a/--all flag
|
@fdncred Sorry, I almost forget it. I have updated the pr to follow your suggestion: #14407 (comment) |
|
I'm not sure this is any better or worse. It's kind of a mixed bag. It would be nice to have some progress indication. If you're in any directory with substance, it looks like it just hangs when it's actually counting things. I'm fine with moving forward with this though. |
# Description Following up for issue comment: #14407 (comment) > it looks like it just hangs when it's actually counting things I noticed that `du` command collects output internally, so it doesn't streaming. This pr is trying to make it streaming # User-Facing Changes NaN # Tests + Formatting NaN
Description
Closes: #14387
To make it happen, just need to added-lflag todu, and pass it toDirBuilder,DirInfo,FileInfoThen tweak
impl From<DirInfo> for Valueandimpl From<FileInfo> for Valueimpl.Edit: this PR is going to:
-l/--longflag to output directories and files columnsdu, it will output the files as well. Previously it doesn't output the size of file.To make it happen, just need to added
-rflag todu, and pass it toDirBuilder,DirInfo,FileInfoThen tweak
impl From<DirInfo> for Valueandimpl From<FileInfo> for Valueimpl.And rename some variables.
User-Facing Changes
duis no longer outputdirectoriesandfilecolumns by default, added-rflag will showdirectoriescolumn,-fflag will showfilescolumn.Tests + Formatting
Added 1 test
After Submitting
NaN