diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-03-06 07:31:42 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-03-06 07:31:42 +0800 |
commit | cf342dd00eaae8667984e77eb565040c132f160a (patch) | |
tree | 6b0118e0cceb7412e5a5aec98de6756445c7fa90 /packages/sra-report/src/index.ts | |
parent | 08ab81c54c1e845a4239648e8cea65a930fcc99d (diff) | |
download | dexon-sol-tools-cf342dd00eaae8667984e77eb565040c132f160a.tar.gz dexon-sol-tools-cf342dd00eaae8667984e77eb565040c132f160a.tar.zst dexon-sol-tools-cf342dd00eaae8667984e77eb565040c132f160a.zip |
Change url command line option to endpoint-url
Diffstat (limited to 'packages/sra-report/src/index.ts')
-rw-r--r-- | packages/sra-report/src/index.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/sra-report/src/index.ts b/packages/sra-report/src/index.ts index 327c495ae..c74b5cb40 100644 --- a/packages/sra-report/src/index.ts +++ b/packages/sra-report/src/index.ts @@ -19,9 +19,9 @@ const SUPPORTED_NETWORK_IDS = [1, 42]; // extract command line arguments const args = yargs - .option('url', { - alias: ['u'], - describe: 'API endpoint to test for standard relayer API compliance', + .option('endpoint-url', { + alias: ['e'], + describe: 'API endpoint url to test for standard relayer API compliance', type: 'string', demandOption: true, }) @@ -38,13 +38,13 @@ const args = yargs type: 'number', default: DEFAULT_NETWORK_ID, }) - .example("$0 --url 'http://api.example.com' --out 'src/contracts/generated/' --network-id 42", 'Full usage example') + .example("$0 --endpoint-url 'http://api.example.com' --out 'src/contracts/generated/' --network-id 42", 'Full usage example') .argv; // perform extra validation on command line arguments try { - assert.isWebUri('args', args.url); + assert.isWebUri('args', args.endpointUrl); } catch (err) { - utils.log(`${chalk.red(`Invalid url format:`)} ${args.url}`); + utils.log(`${chalk.red(`Invalid url format:`)} ${args.endpointUrl}`); process.exit(1); } if (!_.includes(SUPPORTED_NETWORK_IDS, args.networkId)) { @@ -54,7 +54,7 @@ if (!_.includes(SUPPORTED_NETWORK_IDS, args.networkId)) { } const mainAsync = async () => { - const httpClient = new HttpClient(args.url); + const httpClient = new HttpClient(args.endpointUrl); const orders = await httpClient.getOrdersAsync(); const firstOrder = _.head(orders); if (_.isUndefined(firstOrder)) { @@ -62,7 +62,7 @@ const mainAsync = async () => { } const newmanEnvironmentOptions = { collection: sraReportCollectionJSON, - globals: postmanEnvironmentFactory.createGlobalEnvironment(args.url, firstOrder), + globals: postmanEnvironmentFactory.createGlobalEnvironment(args.endpointUrl, firstOrder), environment: postmanEnvironmentFactory.createNetworkEnvironment(args.networkId), }; const newmanReporterOptions = !_.isUndefined(args.output) |