From fa35768fc9647c475f8132c6b431102a30b4efe1 Mon Sep 17 00:00:00 2001 From: Olaf Tomalka Date: Wed, 31 Jan 2018 00:41:58 +0100 Subject: Removed deprecated CLI options --- packages/abi-gen/src/index.ts | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'packages/abi-gen/src/index.ts') diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts index 3628adff8..5412d11ce 100644 --- a/packages/abi-gen/src/index.ts +++ b/packages/abi-gen/src/index.ts @@ -17,11 +17,9 @@ import { utils } from './utils'; const ABI_TYPE_CONSTRUCTOR = 'constructor'; const ABI_TYPE_METHOD = 'function'; const ABI_TYPE_EVENT = 'event'; -const MAIN_TEMPLATE_NAME = 'contract.mustache'; const args = yargs .option('abis', { - alias: ['abiGlob'], describe: 'Glob pattern to search for ABI JSON files', type: 'string', demandOption: true, @@ -41,20 +39,9 @@ const args = yargs .option('template', { describe: 'Path for the main template file that will be used to generate each contract', type: 'string', + demandOption: true, normalize: true, }) - .group(['templates'], 'Deprecated') - .option('templates', { - describe: 'Folder where to search for templates', - type: 'string', - }) - .conflicts('templates', ['partials', 'template-file']) - .check(argv => { - if (!argv.template && !argv.templates) { - throw new Error('You need specify the location of the template'); - } - return true; - }) .example("$0 --abis 'src/artifacts/**/*.json' --out 'src/contracts/generated/' --partials 'src/templates/partials/**/*.handlebars' --template 'src/templates/contract.handlebars'", 'Full usage example') .argv; @@ -81,11 +68,7 @@ Handlebars.registerHelper('returnType', utils.solTypeToTsType.bind(utils, ParamK if (args.partials) { registerPartials(args.partials); } -if (args.templates) { - registerPartials(`${args.templates}/partials/**/*.{mustache,handlebars}`); -} - -const mainTemplate = utils.getNamedContent(args.template ? args.template : `${args.templates}/${MAIN_TEMPLATE_NAME}`); +const mainTemplate = utils.getNamedContent(args.template); const template = Handlebars.compile(mainTemplate.content); const abiFileNames = globSync(args.abis); -- cgit v1.2.3