@codefresh-io/cf-git-providers
Version:
An NPM module/CLI for interacting with various git providers
34 lines • 1.44 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.builder = exports.usage = exports.desc = exports.command = void 0;
const helpers_1 = require("../../../helpers");
exports.command = 'list';
exports.desc = 'list various git repository resources';
exports.usage = 'Usage: $0 list <resource> [options]';
const builder = (yargs) => yargs
.commandDir('../list', {
extensions: ['cmd.js', 'cmd.ts'],
})
.demandCommand(2, (0, helpers_1.errormsg) `must specify the resource type`)
.option('output', {
alias: 's',
describe: 'Where to save the command output to',
defaultDescription: 'prints stdout',
type: 'string'
})
.option('limit', {
alias: 'l',
describe: 'Limit the number of resources returned',
defaultDescription: 'no limit',
type: 'number'
})
.option('page', {
alias: 'p',
describe: 'What page to start returning results from (starting from 1), page size is always 100',
defaultDescription: 'first page',
type: 'number'
})
.example(`$0 ${exports.command} branches -o some-owner -r some-repo`, 'Will display a list of all branches in the specified git repository')
.example(`$0 ${exports.command} branches -o some-owner -r some-repo -l 120 -p 5`, 'Will display a list of 120 branches starting from page 5 (skip first 400 branches) in the specified git repository');
exports.builder = builder;
//# sourceMappingURL=list.cmd.js.map