Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
change admin arg to role, exclude from docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonpecora committed Oct 21, 2020
1 parent a027846 commit ea8f5f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/commands/create-apikey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {cli} from 'cli-ux'

export default class CreateApikey extends BaseCommand {
static description = 'Create an API key for a Backend by id'
static hidden = true

static examples = [
'$ slash-graphql create-apikey "0xid"',
Expand All @@ -14,7 +15,7 @@ export default class CreateApikey extends BaseCommand {
static flags = {
...BaseCommand.commonFlags,
name: flags.string({char: 'n', description: 'Client name', default: 'slash-graphql-cli'}),
admin: flags.boolean({char: 'a', description: 'Grant admin role', default: false})
role: flags.string({char: 'r', description: 'Client role', default: 'client', options: ['admin', 'client']})
}

static args = [{name: 'id', description: 'Backend id', required: true}]
Expand Down Expand Up @@ -47,7 +48,7 @@ export default class CreateApikey extends BaseCommand {
},
body: JSON.stringify({
name: opts.args.name,
role: opts.args.admin ? 'admin' : 'client'
role: opts.args.role
})
})
if (response.status !== 200) {
Expand Down

0 comments on commit ea8f5f0

Please sign in to comment.