diff --git a/solhint.js b/solhint.js index b2f8daf8..44341d28 100755 --- a/solhint.js +++ b/solhint.js @@ -14,6 +14,7 @@ function init() { program .usage('[options] [...other_files]') .option('-f, --formatter [name]', 'report formatter name (stylish, table, tap, unix)') + .option('-q, --quiet', 'report errors only - default: false') .description('Linter for Solidity programming language') .action(execMainAction); @@ -39,6 +40,11 @@ function execMainAction() { const reportLists = program.args.filter(_.isString).map(processPath); const reports =_.flatten(reportLists); + if (program.quiet) { + // filter the list of reports, to set errors only. + reports[0].reports = reports[0].reports.filter(i => i.severity === 2); + } + printReports(reports, program.formatter); exitWithCode(reports); }