Skip to content

Commit f42ffe3

Browse files
authored
Merge pull request #563 from olgn/cli-err-warn-text-disctinction
indicate issue severity in console output of cli
2 parents cff50f9 + 0a962e1 commit f42ffe3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

cli.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ module.exports = function(dir, options) {
2020
if (issues.errors.length === 1 && issues.errors[0].code === '61') {
2121
console.log(
2222
colors.red(
23-
'The directory ' +
23+
'[ERR] The directory ' +
2424
dir +
2525
' failed an initial Quick Test. This means the basic names and structure of the files and directories do not comply with BIDS specification. For more info go to http://bids.neuroimaging.io/',
2626
),
2727
)
2828
} else if (issues.config && issues.config.length >= 1) {
29-
console.log(colors.red('Invalid Config File'))
29+
console.log(colors.red('[ERR] Invalid Config File'))
3030
for (var i = 0; i < issues.config.length; i++) {
3131
var issue = issues.config[i]
3232
issue.file.file = { relativePath: issue.file.path }
@@ -58,14 +58,16 @@ module.exports = function(dir, options) {
5858
}
5959

6060
function logIssues(issues, color, options) {
61+
const severity = color == 'red' ? 'ERR' : 'WARN'
6162
for (var i = 0; i < issues.length; i++) {
62-
var issue = issues[i]
63+
const issue = issues[i]
64+
const issueNumber = i + 1
6365
console.log(
6466
'\t' +
6567
colors[color](
66-
i +
67-
1 +
68+
issueNumber +
6869
': ' +
70+
`[${severity}] ` +
6971
issue.reason +
7072
' (code: ' +
7173
issue.code +

0 commit comments

Comments
 (0)