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 | |
parent | 08ab81c54c1e845a4239648e8cea65a930fcc99d (diff) | |
download | dexon-0x-contracts-cf342dd00eaae8667984e77eb565040c132f160a.tar.gz dexon-0x-contracts-cf342dd00eaae8667984e77eb565040c132f160a.tar.zst dexon-0x-contracts-cf342dd00eaae8667984e77eb565040c132f160a.zip |
Change url command line option to endpoint-url
-rw-r--r-- | packages/sra-report/README.md | 2 | ||||
-rw-r--r-- | packages/sra-report/src/index.ts | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/packages/sra-report/README.md b/packages/sra-report/README.md index 49609aeb2..53c007e10 100644 --- a/packages/sra-report/README.md +++ b/packages/sra-report/README.md @@ -13,7 +13,7 @@ sra-report Options: --help Show help [boolean] --version Show version number [boolean] - --url, -u API endpoint to test for standard relayer API compliance + --endpoint-url, -e API endpoint url to test for standard relayer API compliance [string] [required] --output, -o, --out Folder where to write the reports [string] --network-id, -n ID of the network that the API is serving orders from 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) |