Skip to content

Commit

Permalink
feat(kinsta): add json format for site:list
Browse files Browse the repository at this point in the history
  • Loading branch information
codepuncher committed Nov 1, 2024
1 parent ccd756a commit bbfde0a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/commands/kinsta/sites/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,22 @@ export default class List extends KinstaCommand {
required: true,
env: 'IROOTS_KINSTA_COMPANY_ID',
}),
format: Flags.string({
required: false,
default: 'table',
options: ['json', 'table'],
}),
}

public async run(): Promise<void> {
const {flags} = await this.parse(List)
const {apiKey, company} = flags
const {apiKey, company, format} = flags

const sites = await getAllSites(apiKey, company)
console.table(sites)
if (format === 'json') {
console.log(JSON.stringify(sites))
} else {
console.table(sites)
}
}
}

0 comments on commit bbfde0a

Please sign in to comment.