From ee006be1a79d549f022cf5762a1cc215a2e00b0b Mon Sep 17 00:00:00 2001 From: Viraj Indasrao Date: Thu, 17 Jan 2019 21:54:28 +0530 Subject: [PATCH] per_page command line argument added for dns zones --- cli.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli.js b/cli.js index 2281053..6748d6e 100644 --- a/cli.js +++ b/cli.js @@ -92,6 +92,10 @@ require('yargs') // eslint-disable-line describe: 'limit to a particular zone by name', default: '' }) + yargs.option('per_page', { + describe: 'set number of records per page', + default: '20' + }) }, (argv) => { if (!(process.env.CLOUDFLARE_EMAIL && process.env.CLOUDFLARE_TOKEN)) { console.log('You must define both CLOUDFLARE_EMAIL and CLOUDFLARE_TOKEN as env vars') @@ -101,7 +105,7 @@ require('yargs') // eslint-disable-line email: process.env.CLOUDFLARE_EMAIL, key: process.env.CLOUDFLARE_TOKEN }) - cf.zones.browse().then(function (zones) { + cf.zones.browse(params = {'per_page':argv.per_page}).then(function (zones) { for (let zoneDetails of zones.result) { if (!argv.zone || zoneDetails.name === argv.zone) { cf.dnsRecords.browse(zoneDetails.id).then(async function (firstPage) {