-
-
Notifications
You must be signed in to change notification settings - Fork 252
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
Add option to print file being deleted (-V or --verbose) #183
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ function defaults (options) { | |
} | ||
options.disableGlob = options.disableGlob || false | ||
options.glob = options.glob || defaultGlobOpts | ||
options.verbose = options.verbose || false | ||
} | ||
|
||
function rimraf (p, options, cb) { | ||
|
@@ -107,6 +108,9 @@ function rimraf (p, options, cb) { | |
if (er.code === "ENOENT") er = null | ||
} | ||
|
||
if (options.verbose) | ||
console.log('deleting', p) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fwiw, we should use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? It's just writing a string to stdout, in this case they're 100% equivalent, I almost always use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A lot of terminal profiles can be (and are) setup to visually highlight different forms of logs. afaik there is also a screen reader for terminal output which can differentiate between log & info. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may dismiss this suggestion if it isn't aligned with other code here. I did prefix this with fwiw - not a deal breaker for most. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are literally the same function: https://github.com/nodejs/node/blob/main/lib/internal/console/constructor.js#L682 The only way you could highlight different forms of logs is by patching the global They're displayed differently in the browser, but in Node, they're 100% identical, just same function with two different names. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah okay, thanks for informing me. I wasn't aware of this. |
||
|
||
timeout = 0 | ||
next(er) | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
rm
command supports-v
(lowercase) instead of-V
. We could support both.