Skip to content

Commit cf45429

Browse files
committed
feat(cli): add --pretty-json option for list
Output in pretty json format.
1 parent f0062cb commit cf45429

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/cli.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ cli.command('list', 'List changesets')
4444
.option('--max <version>', 'Maximum version (included)')
4545
.option('--grep <version>', 'Grep version')
4646
.option('--json', 'Output in json format')
47+
.option('--pretty-json', 'Output in pretty json format')
4748
.option('--all', 'List all changesets (alpha/beta included)')
4849
.option('--beta', 'List alpha/beta changesets')
4950
.option('--versions', 'Output only the available Unity versions')
@@ -76,7 +77,10 @@ cli.command('list', 'List changesets')
7677
results = results.map(r => r.version);
7778

7879
// Output in json format or plain
79-
if (options.json) {
80+
if (options.prettyJson) {
81+
console.log(JSON.stringify(results, null, ' '));
82+
}
83+
else if (options.json) {
8084
console.log(JSON.stringify(results));
8185
}
8286
else {

0 commit comments

Comments
 (0)