@@ -88,13 +88,14 @@ function setupCommand(
88
88
const cli = meow (
89
89
`
90
90
Usage
91
- $ ${ name } <org slug>
91
+ $ ${ name }
92
92
93
93
Options
94
94
${ printFlagList ( flags , 6 ) }
95
95
96
96
Examples
97
- $ ${ name } FakeOrg
97
+ $ ${ name }
98
+ $ ${ name } --perPage=5 --page=2 --direction=asc --filter=joke
98
99
` ,
99
100
{
100
101
argv,
@@ -135,7 +136,7 @@ type ThreatResult = {
135
136
}
136
137
137
138
async function fetchThreatFeed (
138
- { per_page, page, direction, filter } : CommandContext ,
139
+ { per_page, page, direction, filter, outputJson } : CommandContext ,
139
140
spinner : Ora ,
140
141
apiKey : string
141
142
) : Promise < void > {
@@ -146,6 +147,10 @@ async function fetchThreatFeed(
146
147
147
148
spinner . stop ( )
148
149
150
+ if ( outputJson ) {
151
+ return console . log ( data )
152
+ }
153
+
149
154
const screen = blessed . screen ( )
150
155
151
156
var table = contrib . table (
@@ -159,7 +164,7 @@ async function fetchThreatFeed(
159
164
, height : '100%'
160
165
, border : { type : "line" , fg : "cyan" }
161
166
, columnSpacing : 5 //in chars
162
- , columnWidth : [ 10 , 25 , 10 , 20 , 20 ] /*in chars*/ } )
167
+ , columnWidth : [ 10 , 30 , 10 , 20 , 20 ] /*in chars*/ } )
163
168
164
169
// allow control the table with the keyboard
165
170
table . focus ( )
0 commit comments