File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
templates/cli/lib/commands Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -143,19 +143,24 @@ const login = new Command("login")
143
143
login
144
144
.command('list')
145
145
.description("List available logged accounts.")
146
- .action(actionRunner(async () => {
146
+ .option("-j, --json", "Output in JSON format")
147
+ .action(actionRunner(async ({ json }) => {
147
148
const logins = globalConfig.getLogins();
148
149
const current = globalConfig.getCurrentLogin();
149
150
150
151
const data = [...logins.map((login => {
151
152
return {
152
153
'Current': login.id === current ? '*' : '',
153
154
'ID': login.id,
154
- 'Endpoint ': login.endpoint ,
155
- 'Email ': login.email
155
+ 'Email ': login.email ,
156
+ 'Endpoint ': login.endpoint
156
157
};
157
158
}))];
158
159
160
+ if (json) {
161
+ console.log(data);
162
+ return;
163
+ }
159
164
drawTable(data);
160
165
161
166
}));
You can’t perform that action at this time.
0 commit comments