@corellium/corellium-cli 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" ?>
2
2
  <!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
3
- <coverage lines-valid="0" lines-covered="0" line-rate="NaN" branches-valid="0" branches-covered="0" branch-rate="NaN" timestamp="1717076946903" complexity="0" version="0.1">
3
+ <coverage lines-valid="0" lines-covered="0" line-rate="NaN" branches-valid="0" branches-covered="0" branch-rate="NaN" timestamp="1717515551139" complexity="0" version="0.1">
4
4
  <sources>
5
5
  <source>/builds/middleware/corellium-cli</source>
6
6
  </sources>
@@ -86,7 +86,7 @@
86
86
  <div class='footer quiet pad2 space-top1 center small'>
87
87
  Code coverage generated by
88
88
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
89
- at 2024-05-30T13:49:06.910Z
89
+ at 2024-06-04T15:39:11.147Z
90
90
  </div>
91
91
  <script src="prettify.js"></script>
92
92
  <script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corellium/corellium-cli",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Corellium CLI Tool",
5
5
  "scripts": {
6
6
  "corellium": "node index.js",
@@ -1,4 +1,5 @@
1
1
  const { handleError } = require('../../error')
2
+ const { displayTable } = require('../../table')
2
3
  const { getApi } = require('../../utils')
3
4
 
4
5
  async function builder (yargs) {
@@ -9,6 +10,13 @@ async function builder (yargs) {
9
10
  demandOption: true,
10
11
  describe: 'virtual device id'
11
12
  })
13
+ .option('format', {
14
+ type: 'input',
15
+ describe: 'Output format (default is json) e.g. table',
16
+ string: true,
17
+ choices: ['table', 'json', 'csv'],
18
+ default: 'json'
19
+ })
12
20
  .option('verbose', {
13
21
  alias: 'v',
14
22
  type: 'boolean',
@@ -24,13 +32,9 @@ async function handler (argv) {
24
32
  if (!instance) {
25
33
  throw new Error(`Instance ${argv.instance} not found`)
26
34
  }
27
- console.log(JSON.stringify({
28
- id: instance.id,
29
- flavor: instance.flavor,
30
- type: instance.type,
31
- state: instance.state,
32
- os: instance.os
33
- }))
35
+ await displayTable(argv.format, argv.format === 'json' ? instance : [instance], [
36
+ 'id', 'flavor', 'type', 'state', 'os'
37
+ ], [{ column: 3, width: 5 }, { column: 2, width: 4 }, { column: 1, width: 6 }])
34
38
  } catch (err) {
35
39
  handleError(err, 'Get instance failed', argv.verbose)
36
40
  }
@@ -14,7 +14,8 @@ async function builder (yargs) {
14
14
  type: 'input',
15
15
  describe: 'Output format (default is json) e.g. table',
16
16
  string: true,
17
- choices: ['table', 'json', 'csv']
17
+ choices: ['table', 'json', 'csv'],
18
+ default: 'json'
18
19
  })
19
20
  }
20
21