-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat(cli): add --quiet / -q option #281
Conversation
Stops any successful output. Errors are still outputted.
I would prefer an if check, or alternatively making a log function which encapsulates both the if check and the console.log statement. Overriding globals can cause confusion or maintenance issues. |
This commit creates stdout and stderr functions for outputting with respect to isQuiet and adds support for differing (easier to parse) messages if not connected to a TTY (eg. a pipe or process substitution) Additionally changes the 'No matching files.' message to output on stderr rather than on stdout as it was, which makes sense because this output represents erroneous usage.
I have made this change in my updated PR at #283 |
--help and --version don't need to be checked because they exit the program before reaching this point.
This has been reopened as per @fisker's request. It has been updated to match the master branch + my modifications and should now be ready for review. |
Can you add test for those flags? |
I'm currently working on this on a separate branch. Once I finish, I can copy the relevant tests to this branch. |
Tests have been added |
@fisker any update on this PR? I saw that you approved it, are we waiting for @keithamus to approve it or is there another holdup that I don't know about? |
Let's wait for @keithamus to take a look. |
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.
LGTM 👍 nice work @aarondill 🎉
Thanks @fisker for reviewing and helping get this into great shape!
🎉 This PR is included in version 2.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR creates a --quiet (-q) option that simply stops the CLI from outputting success messages. Node errors and file-not-found errors are still outputted.
Tests have not been written, because the current testing infrastructure doesn't seem to have a way to automatically test the stdout of a CLI call.
closes #280