Skip to content
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

Added --silent flag to silence console logging. #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jake-chapman-mark43
Copy link

Building a cli tool for some stuff at work, and the output is messing with our output. Added a simple --silent flag to silence any of the logging. Not sure your exact thoughts on --silent suppressing the console.error, I've seen libs do either silence everything or have a separate log-level and a silence-errors option.

Works for what I need, but if you have any feedback or suggestions on something a little more flexible, I'm all ears.

Copy link
Owner

@moroshko moroshko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jake-chapman-mark43, just a small comment, and could you also update the README please?

.option("-c, --config", "Path to config file")
.example("-c /path/to/react-scanner.config.js")
.action((options) => {
const configPath = path.resolve(process.cwd(), options.config);
const configDir = path.dirname(configPath);
const config = require(configPath);
run(config, configDir, "cli");
run(config, configDir, "cli", options.silent);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably convert the params to an object at this point. What do you think?

@oAllanWeb
Copy link

@jake-chapman-mark43 @moroshko I liked the solution, do we have a forecast for a version with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants