How to use the @oclif/command.flags.integer 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 ArkEcosystem / core / packages / core-tester-cli / src / commands / multi-signature.ts View on Github external
public static flags = {
        ...BaseCommand.flags,
        multisigFee: customFlags.number({
            description: "multisig fee",
            default: 5,
        }),
        min: flags.integer({
            description: "minimum number of signatures per transaction",
            default: 2,
        }),
        lifetime: flags.integer({
            description: "lifetime of transaction",
            default: 72,
        }),
        quantity: flags.integer({
            description: "number of signatures per wallet",
            default: 3,
        }),
        skipTests: flags.boolean({
            description: "skip transaction tests",
        }),
    };

    /**
     * Run multi-signature command.
     * @return {void}
     */
    public async run(): Promise {
        // tslint:disable-next-line: no-shadowed-variable
        const { flags } = await this.initialize(MultiSignatureCommand);
github ArkEcosystem / core / deprecated / core-snapshots-cli / src / commands / dump.ts View on Github external
import { setUpLite } from "../utils";
import { BaseCommand } from "./command";

export class DumpCommand extends BaseCommand {
    public static description: string = "create a full snapshot of the database";

    public static flags = {
        ...BaseCommand.flags,
        blocks: flags.string({
            description: "blocks to append to, correlates to folder name",
        }),
        start: flags.integer({
            description: "start network height to export",
            default: -1,
        }),
        end: flags.integer({
            description: "end network height to export",
            default: -1,
        }),
        codec: flags.string({
            description: "codec name, default is msg-lite binary",
        }),
    };

    public async run(): Promise {
        // tslint:disable-next-line:no-shadowed-variable
        const { flags } = this.parse(DumpCommand);

        await setUpLite(flags);

        await app.resolvePlugin("snapshots").exportData(flags);
    }
github adobe / aio-cli-plugin-runtime / src / commands / runtime / activation / list.js View on Github external
} catch (err) {
      this.handleError('failed to list the activations', err)
    }
  }
}

ActivationList.args = [
  {
    name: 'activationID'
  }
]

ActivationList.flags = {
  ...RuntimeBaseCommand.flags,
  // example usage:  aio runtime:activation:list --limit 10 --skip 2
  limit: flags.integer({
    char: 'l',
    description: 'only return LIMIT number of activations from the collection with a maximum LIMIT of 200 activations (default 30)'
  }),
  skip: flags.integer({
    char: 's',
    description: 'exclude the first SKIP number of activations from the result'
  }),
  since: flags.integer({
    description: 'return activations with timestamps later than SINCE; measured in milliseconds since Th, 01, Jan 1970'
  }),
  upto: flags.integer({
    description: 'return activations with timestamps earlier than UPTO; measured in milliseconds since Th, 01, Jan 1970'
  }),
  json: flags.boolean({
    description: 'output raw json'
  }),
github box / boxcli / src / commands / folders / download.js View on Github external
/* eslint-enable promise/avoid-new */
	}
}

FoldersDownloadCommand.description = 'Download a folder';
FoldersDownloadCommand.examples = ['box folders:download 22222'];

FoldersDownloadCommand.flags = {
	...BoxCommand.flags,
	destination: flags.string({
		description: 'The destination folder to download the Box folder into',
	}),
	zip: flags.boolean({
		description: 'Download the folder into a single .zip archive',
	}),
	depth: flags.integer({
		description: 'Number of levels deep to recurse when downloading the folder tree',
	})
};

FoldersDownloadCommand.args = [
	{
		name: 'id',
		required: true,
		hidden: false,
		description: 'ID of the folder to download',
	}
];

module.exports = FoldersDownloadCommand;
github adobe / aio-cli-plugin-runtime / src / commands / runtime / action / create.js View on Github external
description: 'treat ACTION as a web action or as a raw HTTP web action', // help description for flag
    options: ['true', 'yes', 'false', 'no', 'raw']
  }),
  'param-file': flags.string({
    char: 'P',
    description: 'FILE containing parameter values in JSON format' // help description for flag
  }),
  timeout: flags.integer({
    char: 't',
    description: 'the timeout LIMIT in milliseconds after which the action is terminated (default 60000)' // help description for flag
  }),
  memory: flags.integer({
    char: 'm',
    description: 'the maximum memory LIMIT in MB for the action (default 256)' // help description for flag
  }),
  logsize: flags.integer({
    char: 'l',
    description: 'the maximum log size LIMIT in MB for the action (default 10)' // help description for flag
  }),
  kind: flags.string({
    description: 'the KIND of the action runtime (example: swift:default, nodejs:default)' // help description for flag
  }),
  annotation: flags.string({
    char: 'a',
    description: 'annotation values in KEY VALUE format', // help description for flag
    multiple: true // allow setting this flag multiple times
  }),
  'annotation-file': flags.string({
    char: 'A',
    description: 'FILE containing annotation values in JSON format' // help description for flag
  }),
  sequence: flags.string({
github ArkEcosystem / core / packages / core-tester-cli / src / commands / make / block.ts View on Github external
import { Delegate } from "@arkecosystem/core-forger";
import { Crypto, Interfaces, Managers } from "@arkecosystem/crypto";
import { flags } from "@oclif/command";
import { writeFileSync } from "fs";
import { satoshiFlag } from "../../flags";
import { copyToClipboard } from "../../utils";
import { BaseCommand } from "../command";

export class BlockCommand extends BaseCommand {
    public static description: string = "create new blocks";

    public static flags = {
        ...BaseCommand.flagsConfig,
        ...BaseCommand.flagsDebug,
        number: flags.integer({
            description: "number of blocks to generate",
            default: 1,
        }),
        transactions: flags.integer({
            description: "number of transactions to generate",
            default: 0,
        }),
        transactionAmount: satoshiFlag({
            description: "initial wallet token amount",
            default: 2,
        }),
        transactionFee: satoshiFlag({
            description: "transfer fee",
            default: 0.1,
        }),
        passphrase: flags.string({
github adobe / aio-cli-plugin-runtime / src / commands / runtime / activation / logs.js View on Github external
{
    name: 'activationId'
  }
]

ActivationLogs.flags = {
  ...RuntimeBaseCommand.flags,
  last: flags.boolean({
    char: 'l',
    description: 'retrieves the most recent activation logs'
  }),
  strip: flags.boolean({
    char: 'r',
    description: 'strip timestamp information and output first line only'
  }),
  count: flags.integer({
    char: 'c',
    description: 'used with --last, return the last `count` activation logs. Max 5',
    default: 1
  })
}

ActivationLogs.description = 'Retrieves the Logs for an Activation'

ActivationLogs.aliases = [
  'runtime:activation:log',
  'runtime:log',
  'runtime:logs',
  'rt:activation:logs',
  'rt:activation:log',
  'rt:log',
  'rt:logs'
github satyarohith / shark / src / commands / volumes / attach.js View on Github external
} else {
        this.log('The request has been initiated. Status:', body.action.status);
      }
    } catch (error) {
      spinner.stop();
      this.error(error.message);
    }
  }
}

VolumesAttachCommand.description = `attach a volume to a droplet (action)`;

VolumesAttachCommand.flags = {
  json: flags.boolean({char: 'j', description: 'output in json format'}),
  id: flags.string({char: 'i', description: 'volume ID', required: true}),
  'droplet-id': flags.integer({char: 'd', description: 'droplet ID', required: true}),
  region: flags.string({char: 'r', description: 'region of the volume'})
};

module.exports = VolumesAttachCommand;
github smartcontractkit / chainlink / belt / src / commands / deploy.ts View on Github external
export default class Deploy extends Command {
  static description = 'Deploys a chainlink smart contract.'

  static examples = [
    'belt deploy []  []',
    'belt deploy v0.6/AccessControlledAggregator 0x01be23585060835e02b77ef475b0cc51aa1e0709 160000000000000000 300 1 1000000000 18 LINK/USD',
  ]
  static strict = false

  static flags = {
    help: flags.help({ char: 'h' }),
    gasPrice: flags.integer({
      char: 'g',
      description: 'Gas price',
    }),
    gasLimit: flags.integer({
      char: 'l',
      description: 'Gas limit',
    }),
    nonce: flags.integer({
      char: 'n',
      description: 'Nonce',
    }),
    value: flags.integer({
      char: 'v',
      description: 'Value',
    }),
    config: flags.string({
      char: 'c',
      default: 'app.config.json',
      description: 'Location of the configuration file',
    }),
github smartcontractkit / chainlink / belt / src / commands / exec.ts View on Github external
static description = 'Executes a chainlink smart contract write function.'

  static examples = [
    'belt exec [] &lt; <address>  []',
    "belt exec v0.6/AccessControlledAggregator 0xe47D8b2CC42F07cdf05ca791bab47bc47Ed8B5CD 'addAccess(address)' 0xe47D8b2CC42F07cdf05ca791bab47bc47Ed8B5CD",
    "belt exec v0.6/AccessControlledAggregator 0xe47D8b2CC42F07cdf05ca791bab47bc47Ed8B5CD 'addOracles(address[],address[],uint32,uint32,uint32)' [0x67b260DffCE59E890CfAe9ec733921357732f90a] [0xd9e6eCFfd3Acb20f80D1BCce3d078653B4E7f87D] 1 100 600",
  ]
  static strict = false

  static flags = {
    help: flags.help({ char: 'h' }),
    gasPrice: flags.integer({
      char: 'g',
      description: 'Gas price',
    }),
    gasLimit: flags.integer({
      char: 'l',
      description: 'Gas limit',
    }),
    nonce: flags.integer({
      char: 'n',
      description: 'Nonce',
    }),
    value: flags.integer({
      char: 'v',
      description: 'Value',
    }),
    config: flags.string({
      char: 'c',
      default: 'app.config.json',
      description: 'Location of the configuration file',
    }),</address>