Skip to content

Commit dd9a94b

Browse files
authored
#711 Removed string formating on cli output (#712)
* #711 Removed string formating on cli output * Updated to fix regression of issue in #701
1 parent 7783341 commit dd9a94b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/cli/cli.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,21 @@ if (process.argv[2] === '--help' || process.argv[2] === '-h') {
4646

4747
const callback = function(xmlData) {
4848
let output = '';
49-
if (validate) {
50-
const parser = new XMLParser(options);
51-
output = parser.parse(xmlData,validate);
52-
} else if (validateOnly) {
49+
if (validateOnly) {
5350
output = XMLValidator.validate(xmlData);
5451
process.exitCode = output === true ? 0 : 1;
55-
} else {
52+
} else {
5653
const parser = new XMLParser(options);
5754
output = JSON.stringify(parser.parse(xmlData,validate), null, 4);
5855
}
5956
if (outputFileName) {
6057
writeToFile(outputFileName, output);
6158
} else {
62-
console.log(JSON.stringify(output, null, 2));
59+
console.log(output);
6360
}
6461
};
6562

63+
6664
try {
6765

6866
if (!fileName) {

0 commit comments

Comments
 (0)