[GH-ISSUE #453] "dust -X node_modules" only removes the current directory's node_modules, not nested ones #199

Closed
opened 2026-06-08 11:26:06 +03:00 by zhus · 2 comments
Owner

Originally created by @edbrannin on GitHub (Dec 5, 2024).
Original GitHub issue: https://github.com/bootandy/dust/issues/453

(Maybe I should just be using dust -v node_modules, but in that case the --help text seems misleading)

Per the helptext:

bruno % dust --help | grep -E 'ignore|invert'
  -X, --ignore-directory <PATH>    Exclude any file or directory with this name
  -I, --ignore-all-in-file <FILE>  Exclude any file or directory with a regex matching that listed in this file, the file entries will be added to the ignore regexs provided by --invert_filter
  -i, --ignore_hidden              Do not display hidden files
  -v, --invert-filter <REGEX>      Exclude filepaths matching this regex. To ignore png files type: -v "\.png$"

With a name like "Exclude any file or directory with this name", it seems like:

  1. -X node_modules should ignore both node_modules and subdir/node_modules
  2. I only need -v if I wanted to match partial filenames with a regex.

Result using dust -X

ebrannin@ebrannin-mbp bruno % dust -X node_modules | grep node_modules
 64M       ┌─┴ node_modules            │███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  │   9%
 64M     │ ┌─┴ node_modules            │███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  │   9%
 64M     │ ┌─┴ node_modules            │███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  │   9%
bruno %

Result using dust -v

(also my desired result of using dust -X

bruno % dust -v node_modules | grep node_modules
bruno %
Originally created by @edbrannin on GitHub (Dec 5, 2024). Original GitHub issue: https://github.com/bootandy/dust/issues/453 (Maybe I should just be using `dust -v node_modules`, but in that case the `--help` text seems misleading) Per the helptext: ```bash bruno % dust --help | grep -E 'ignore|invert' -X, --ignore-directory <PATH> Exclude any file or directory with this name -I, --ignore-all-in-file <FILE> Exclude any file or directory with a regex matching that listed in this file, the file entries will be added to the ignore regexs provided by --invert_filter -i, --ignore_hidden Do not display hidden files -v, --invert-filter <REGEX> Exclude filepaths matching this regex. To ignore png files type: -v "\.png$" ``` With a name like "Exclude any file or directory with this name", it seems like: 1. `-X node_modules` should ignore both `node_modules` and `subdir/node_modules` 2. I only need `-v` if I wanted to match partial filenames with a regex. ## Result using `dust -X` ```bash ebrannin@ebrannin-mbp bruno % dust -X node_modules | grep node_modules 64M ┌─┴ node_modules │███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% 64M │ ┌─┴ node_modules │███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% 64M │ ┌─┴ node_modules │███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% bruno % ``` ## Result using `dust -v` (also my desired result of using `dust -X` ```bash bruno % dust -v node_modules | grep node_modules bruno % ```
zhus closed this issue 2026-06-08 11:26:06 +03:00
Author
Owner

@Its-Just-Nans commented on GitHub (Dec 30, 2024):

Hello

As written in the --help, it's:

  • -X <PATH>
  • -v <REGEX>
<!-- gh-comment-id:2565172195 --> @Its-Just-Nans commented on GitHub (Dec 30, 2024): Hello As written in the `--help`, it's: - `-X <PATH>` - `-v <REGEX>`
Author
Owner

@bootandy commented on GitHub (Jan 15, 2025):

Yeah I've thought about this one myself. I'm not entirely happy with the current design. Adding -v REGEX was a way to make it smarter.

<!-- gh-comment-id:2593778076 --> @bootandy commented on GitHub (Jan 15, 2025): Yeah I've thought about this one myself. I'm not entirely happy with the current design. Adding `-v REGEX` was a way to make it smarter.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#199