Remove console output in favor of a --verbose parameter
eliannelavoie opened this issue · 5 comments
🧩 Feature request
Description
Right now, some commands write using console.info(). For example, ensureDir:
Checking if existing and, if not, creating directory dist/css ...
Directory dist/css exists.
This output seems a bit redundant.
The equivalent fs-extra command doesn't have any console output.
Describe the solution you'd like
The most obvious solution (to me) would be to add a --verbose parameter.
Logs should only be shown if that parameter is specified.
Alternative solutions
Maybe simply remove the console.info() calls?
Thanks for trying/using @atao60/fse-cli.
The equivalent fs-extra command doesn't have any console output.
Yes: fs-extra
is a library, @atao60/fse-cli
... a cli. With the former, the user can choice how to manage the result of a command. With the latter, the only freedom of action is to catch the error code returned on the command line. With the help of any message thrown with it to get what is happening, right or wrong.
Maybe simply remove the console.info() calls?
Not an option
The most obvious solution (to me) would be to add a --verbose parameter.
Ah, des goûts et des couleurs ;-) (no accounting for taste)
May be i'm old school, but i'd prefer the opposite, i.e. --quiet
I'll see if i can do something in the next days. Keep in tune.
But comparable shell programs don't have output describing the normal comportement: only messages for errors.
If you type cp a.txt b.txt
, your shell won't write "Copying a.txt to b.txt...": it'll just copy the file and write nothing.
Same goes for touch a.txt
, rm -rf
, mkdir -p
. etc. If ensureDir, remove and ensureFile are supposed to be aliases of those commands, why shouldn't they behave like it?
Same goes for the other CLI npm packages you're trying to replace: mkdirp
doesn't have superfluous output, rimraf
doesn't have superfluous output...
If ensureDir, remove and ensureFile are supposed to be aliases of those commands, why shouldn't they behave like it?
Same goes for the other CLI npm packages you're trying to replace: mkdirp doesn't have superfluous output, rimraf doesn't have superfluous output...
It seems there is quite a misunderstanding here:
- @atao/fse-cli was never thought as a mere substitute of those commands
- and it's all about what one means by alias, behavior or superfluous.
From my point of view, regarding alias/behavior, only file system functionalities matter, i.e. the changes applied on the file system.
The outputs on the command line are only convenient information as one wishes.
It's just the point: I'm the kind to always use verbose option with commands like 'mv', 'mkdir', 'cp', ...
So if I can't write a CLI without please myself...
But I fully agree that offering the choice is a legitimate expectation (with verbose as default ;-)).
@eliannelavoie I just released a new version with option '--quiet'.
If you don't want to deal with option '--quiet' in each launch of fse-cli command, then you can set up env var FSE_CLI_QUIET=true
. All following commands will be in 'quiet' mode until you unset FSE_CLI_QUIET.
Rule of Silence: When a program has nothing surprising to say, it should say nothing.
Basics of the Unix Philosophy
counter-example: npx