How to use the @oclif/command.Command.flags function in @oclif/command

To help you get started, we’ve selected a few @oclif/command examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fauna / fauna-shell / src / lib / fauna-command.js View on Github external
dbExists(dbName, callback) {
    return this.withClient(function (testDbClient, _) {
      return testDbClient.query(q.Exists(q.Database(dbName)))
      .then(callback)
    })
  }
}

/**
* These flags allow the user to override endpoint configuration.
* They are inherited by all shell commands that extend FaunaCommand.
* See each command's flags to see how this mechanism works.
*/
FaunaCommand.flags = {
  ...Command.flags,
  domain: flags.string({
    description: 'FaunaDB server domain',
  }),
  scheme: flags.string({
    description: 'Connection scheme',
    options: ['https', 'http'],
  }),
  port: flags.string({
    description: 'Connection port',
  }),
  timeout: flags.string({
    description: 'Connection timeout in milliseconds',
  }),
  secret: flags.string({
    description: 'FaunaDB secret key',
  }),