How to use the @oclif/command.flags.boolean 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 adobe / aio-cli-plugin-runtime / src / commands / runtime / property / get.js View on Github external
}
}

PropertyGet.flags = {
  // override property command flags, they need to be boolean type, not string
  ...Object.assign(RuntimeBaseCommand.flags, RuntimeBaseCommand.propertyFlags({ asBoolean: true })),
  namespace: flags.boolean({
    description: 'whisk namespace'
  }),
  all: flags.boolean({
    description: 'all properties'
  }),
  apibuild: flags.boolean({
    description: 'whisk API build version'
  }),
  apibuildno: flags.boolean({
    description: 'whisk API build number'
  }),
  cliversion: flags.boolean({
    description: 'whisk CLI version'
  })
}

PropertyGet.description = 'get property'

PropertyGet.aliases = [
  'runtime:prop:get',
  'rt:property:get',
  'rt:prop:get'
]

module.exports = PropertyGet
github celo-org / celo-monorepo / packages / cli / src / commands / election / activate.ts View on Github external
import { sleep } from '@celo/utils/lib/async'
import { flags } from '@oclif/command'
import { cli } from 'cli-ux'
import { BaseCommand } from '../../base'
import { newCheckBuilder } from '../../utils/checks'
import { displaySendTx } from '../../utils/cli'
import { Flags } from '../../utils/command'

export default class ElectionVote extends BaseCommand {
  static description =
    'Activate pending votes in validator elections to begin earning rewards. To earn rewards as a voter, it is required to activate your pending votes at some point after the end of the epoch in which they were made.'

  static flags = {
    ...BaseCommand.flags,
    from: Flags.address({ required: true, description: "Voter's address" }),
    wait: flags.boolean({ description: 'Wait until all pending votes can be activated' }),
  }

  static examples = [
    'activate --from 0x4443d0349e8b3075cba511a0a87796597602a0f1',
    'activate --from 0x4443d0349e8b3075cba511a0a87796597602a0f1 --wait',
  ]
  async run() {
    const res = this.parse(ElectionVote)

    this.kit.defaultAccount = res.flags.from
    await newCheckBuilder(this, res.flags.from)
      .isSignerOrAccount()
      .runChecks()

    const election = await this.kit.contracts.getElection()
    const accounts = await this.kit.contracts.getAccounts()
github adobe / aio-cli-plugin-runtime / src / commands / runtime / rule / list.js View on Github external
}

RuleList.description = 'Retrieves a list of Rules'

RuleList.flags = {
  ...RuntimeBaseCommand.flags,
  limit: flags.integer({
    char: 'l',
    description: 'Limit number of rules returned. Default 30',
    default: 30
  }),
  skip: flags.integer({
    char: 's',
    description: 'Skip number of rules returned'
  }),
  json: flags.boolean({
    description: 'output raw json'
  }),
  'name-sort': flags.boolean({
    description: 'sort results by name'
  }),
  name: flags.boolean({
    char: 'n',
    description: 'sort results by name'
  })
}

RuleList.aliases = [
  'runtime:rule:ls',
  'rt:rule:list',
  'rt:rule:ls'
]
github GetStream / stream-cli / src / commands / chat / push / apn.js View on Github external
}),
	p12_cert: flags.string({
		char: 'c',
		description: 'Absolute path to .p12 file.',
		required: false,
	}),
	notification_template: flags.string({
		char: 'n',
		description: 'JSON template for notifications.',
		required: false,
	}),
	disable: flags.boolean({
		description: 'Disable APN push notifications and clear config.',
		required: false,
	}),
	json: flags.boolean({
		char: 'j',
		description:
			'Output results in JSON. When not specified, returns output in a human friendly format.',
		required: false,
	}),
};

PushApn.description = 'Specifies APN for push notifications.';

module.exports.PushApn = PushApn;
github wordup-dev / wordup-cli / src / commands / install.js View on Github external
...
If there is no wpInstall config in .wordup/config.yml, a setup for your installation will be shown.
You can set a custom site url for WordPress, but please be aware that you have to proxy this url to your localhost:port

The web frontend for the catched emails (MailHog) is available on localhost:[WORDPRESS_PORT + 1]

Wordup will assign automatically a different default port, if the default port of 8000 is taken by another wordup project.

Note: Flags in this command overrule the wordup config.yml.
`

InstallCommand.flags = {
  ...Command.flags,
  port: flags.string({char: 'p', description: 'Install on a different port', default:'8000'}),
  siteurl: flags.string({description: 'Specify a custom WordPress site url. Use --help for details.'}),
  force: flags.boolean({char: 'f', description: 'Force the installation of the project (deprecated)', hidden:true}),
  prompt: flags.boolean({description: 'If you want to do the setup again', exclusive: ['archive','connect']}),
  archive: flags.string({description: 'Install from a wordup archive.'}),
  connect: flags.string({description: 'Install from a WordPress running website.', exclusive: ['archive']}),
  'private-key': flags.string({description: 'Private key for the wordup-connect plugin', exclusive: ['archive'], dependsOn: ['connect']}),
}

module.exports = InstallCommand
github LiskHQ / lisk-sdk / commander / src / commands / core / install.ts View on Github external
},
	];

	static description = 'Install an instance of Lisk Core.';

	static examples = [
		'core:install lisk-mainnet',
		'core:install --no-start lisk-mainnet',
		'core:install --no-snapshot lisk-mainnet',
		'core:install --lisk-version=2.0.0 lisk-mainnet',
		'core:install --network=testnet --release-url=https://downloads.lisk.io/lisk/mainnet/1.6.0/lisk-1.6.0-Linux-x86_64.tar.gz lisk-mainnet',
		'core:install --network=mainnet --snapshot-url=https://downloads.lisk.io/lisk/mainnet/blockchain.db.gz custom-mainnet',
	];

	static flags = {
		json: flagParser.boolean({
			...BaseCommand.flags.json,
			hidden: true,
		}),
		pretty: flagParser.boolean({
			...BaseCommand.flags.pretty,
			hidden: true,
		}),
		'installation-path': flagParser.string({
			...commonFlags.installationPath,
			default: '~/.lisk/instances',
			hidden: true,
		}),
		'lisk-version': flagParser.string({
			...commonFlags.liskVersion,
		}),
		'no-snapshot': flagParser.boolean({
github GetStream / stream-cli / src / commands / chat / message / update.js View on Github external
char: 'm',
		description: 'The unique identifier for the message.',
		required: false,
	}),
	text: flags.string({
		char: 't',
		description: 'The message you would like to send as text.',
		required: false,
	}),
	attachments: flags.string({
		char: 'a',
		description:
			'A JSON payload of attachments to send along with a message.',
		required: false,
	}),
	json: flags.boolean({
		char: 'j',
		description:
			'Output results in JSON. When not specified, returns output in a human friendly format.',
		required: false,
	}),
};

MessageUpdate.description = 'Updates a message.';

module.exports.MessageUpdate = MessageUpdate;
github satyarohith / shark / src / commands / actions / list.js View on Github external
description: 'filter property by partial string matching, ex: name=foo'
  }),
  csv: flags.boolean({
    exclusive: ['no-truncate'],
    description: 'output is csv format'
  }),
  extended: flags.boolean({char: 'x', description: 'show extra columns'}),
  'no-truncate': flags.boolean({
    exclusive: ['csv'],
    description: 'do not truncate output to fit screen'
  }),
  'no-header': flags.boolean({
    exclusive: ['csv'],
    description: 'hide table header from output'
  }),
  json: flags.boolean({char: 'j', description: 'output in json format'}),
  page: flags.integer({
    char: 'p',
    description: 'specific page to request'
  })
};

module.exports = ActionsListCommand;
github Bearer / bearer-js / packages / cli / src / commands / generate / spec.ts View on Github external
import { flags } from '@oclif/command'
import * as fs from 'fs'
import * as path from 'path'

import BaseCommand from '../../base-command'
import { RequireIntegrationFolder, skipIfNoViews } from '../../utils/decorators'
import { copyFiles } from '../../utils/helpers'

export default class GenerateSpec extends BaseCommand {
  static description = 'Generate spec file for bearer integration'
  static hidden = true
  static flags = {
    ...BaseCommand.flags,
    force: flags.boolean({})
  }

  static args = []

  @skipIfNoViews()
  @RequireIntegrationFolder()
  async run() {
    const { flags } = this.parse(GenerateSpec)
    const targetFolder = this.locator.integrationRoot
    if (flags.force || !specExists(targetFolder)) {
      try {
        await copyFiles(this, 'generate/integration_specs', targetFolder, {})
        this.success('Spec file successfully generated! 🎉')
      } catch (e) {
        this.error(e)
      }
github box / boxcli / src / commands / users / create.js View on Github external
description: 'Exempt user from device limits',
		allowNo: true
	}),
	'exempt-from-2fa': flags.boolean({
		description: 'Exempt user from two-factor auth',
		allowNo: true
	}),
	'restrict-external-collab': flags.boolean({
		description: 'Restrict user from external collaboration',
		allowNo: true
	}),
	'can-see-managed-users': flags.boolean({
		description: 'User can see managed users',
		allowNo: true
	}),
	'password-reset': flags.boolean({
		description: 'Force the user to reset password'
	}),
	role: flags.string({
		char: 'r',
		description: 'Role of user. Enter user or coadmin',
		options: [
			'user',
			'coadmin'
		]
	}),
	language: flags.string({
		char: 'l',
		description: 'Language of the user (ISO 639-1 Language Code). https://developer.box.com/v2.0/docs/api-language-codes'
	}),
	'job-title': flags.string({
		char: 'j',