|
|
@ -2,7 +2,7 @@
|
|
|
|
'use strict'
|
|
|
|
'use strict'
|
|
|
|
const meow = require('meow')
|
|
|
|
const meow = require('meow')
|
|
|
|
const stdin = require('get-stdin')
|
|
|
|
const stdin = require('get-stdin')
|
|
|
|
const jsome = require('jsome')
|
|
|
|
const pretty = require('@medv/prettyjson')
|
|
|
|
|
|
|
|
|
|
|
|
const cli = meow(`
|
|
|
|
const cli = meow(`
|
|
|
|
Usage
|
|
|
|
Usage
|
|
|
@ -35,7 +35,7 @@ async function main() {
|
|
|
|
if (typeof result === 'undefined') {
|
|
|
|
if (typeof result === 'undefined') {
|
|
|
|
process.stderr.write('undefined\n')
|
|
|
|
process.stderr.write('undefined\n')
|
|
|
|
} else if (process.stdout.isTTY) {
|
|
|
|
} else if (process.stdout.isTTY) {
|
|
|
|
jsome(result)
|
|
|
|
console.log(pretty(result))
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
console.log(JSON.stringify(result, null, 2))
|
|
|
|
console.log(JSON.stringify(result, null, 2))
|
|
|
|
}
|
|
|
|
}
|
|
|
|